I want to use this function to calculate but it keeps telling me this problem.My "means" is 1*2,and "covars" is 2*2 array.And the length of "means" and ncols of "covars" is the same.I don't know why...
This is my codes

and this is the wrong message
 my inputs are
my inputs are  
 weights<-c(1/3,1/3,1/3)
means<-matrix(1:6,nrow=3,byrow=FALSE)
covars<-array(1,dim=c(2,2,3))
EM(d,weights,means,covars,300,3,10,0.0001)
and the "d" is
the d is a 300*2 matrix.I capture a little. I'm so sorry that I don't have a good command of this website and I don't know how to put so many data on it.
Thank you so much!
 
    