> I will use the lca method in the e1071 package. But I get the following 
error:
> Error in pas[j, ] <- drop(exp(rep(1, nvar) %*% log(mp))) :
>   number of items to replace is not a multiple of replacement length
> 
> Does anybody know this error and knows what this means?

The error means that you are trying to assign a variable of one size to a 
variable of another fixed size.  An example that recreates it is:
x <- matrix(1:6, nrow=3)
x[1,] <- 1:10

x[1,] cannot be resized from 3 to 10 without affecting the rest of x, so 
an error is thrown.

In your example, the jth row of the matrix pas is a different size from 
drop(exp(rep(1, nvar) %*% log(mp))).

Since you haven't provided a reproducible example (tut tut, read the 
posting guide) you'll have to do the debugging yourself.

To get you started, type traceback() to see where the problem occurs.

Now try options(error=recover), and call the lca function again.  Now you 
can examine the values of nvar, mp and pas to see what is going wrong.

Regards,
Richie.

Mathematical Sciences Unit
HSL



------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to