title: What does applying as.numeric to a dendrogram in R do?
body: <p>When I cut a dendrogram tree:</p>
  
  <pre><code>## 4. 3-cluster solution
  cl.hw3 &lt;- cutree(cl.ward, k=3)
  </code></pre>
  
  <p>And then try to run a logistic regression on it:</p>
  
  <pre><code>## 7. Logistic regression
  cl1 &lt;- as.numeric(cl.hw3==2)
  logreg1 &lt;- glm(cl1 ~ sex + birthyr + plingu02, family=binomial, data=biofam)
  summary(logreg1)
  </code></pre>
  
  <p>What is it that happens in the first step (cl1 &lt;- as.numeric(cl.hw3==1)? Does the assignment operator == recut the dendrogram tree clusters with the number I give (2 rather than 3 in this case)?</p>