title: R Warning: Mistake in factor
body: <p>My R code is:</p>
  
  <pre><code>means_log_adj &lt;- aggregate(lab_data[,delta_touse], 
      by = list(
          factor(mydata_adj$Response_EP, labels = c("non_responder", "responder")), 
          factor(mydata_adj$sex,labels = c("male","female")), 
          factor(mydata_adj$timepoint,labels = c("baseline","wk1","wk2","EP"))),
      mean)
  
  Warning message: 
  &gt; mistake in factor
  &gt; (mydata_adj$Response_EP, labels =
  &gt; c("non-responder", "responder")):
  &gt; invalid labels; length 2 should be 1
  &gt; or 0.
  </code></pre>
  
  <p>Could anybody help me to solve my problem?</p>