title: Error in dim(data) <- dim : invalid first argument
body: <p>I am trying to run this code but I keep receiving an error message saying </p>
  
  <blockquote>
    <p>Error in dim(data) &lt;- dim : invalid first argument</p>
  </blockquote>
  
  <pre><code>sigma &lt;- matrix(c(1.0, 0,
                    0, 1.0), nrow = 2)
  mu1 &lt;- c(0.5,1.5)
  mu2 &lt;- c(1,2)
  mu3 &lt;- c(1.5,2.5)
  
  sim=100
  t2err=0
  for (i in 1:sim){
    x1 &lt;- data.frame(mvrnorm(n = 10, mu = mu1, Sigma = sigma),
                     subjects = c(rep('1', 10)))
    x2 &lt;- data.frame(mvrnorm(n = 10, mu = mu2, Sigma = sigma),
                     subjects = c(rep('2', 10)))                
    x3 &lt;- data.frame(mvrnorm(n = 10, mu = mu3, Sigma = sigma),
                     subjects = c(rep('3', 10)))
    x &lt;- rbind(x1,x2,x3)
    ## p-value ##
    if (((summary(manova(as.matrix(cbind(x[,1:2])~x$subjects)),'Wilks'))$stats[1,6]) &gt; 0.05) (t2err=t2err+1) 
  
  }
  cat("Power rate in percentage is",(1-(t2err/sim))*100,"%")
  </code></pre>
  
  <p>Does anyone know what went wrong? because when I do the same thing with only x1 instead of x=(x1,x2,x3), everything seems to be okay.</p>
  
  <p>Thank you.</p>