[R] Error in rmultinom(n, size, prob) : too few positive probabilities

Ethan Johnsons ethan.johnsons at gmail.com
Sat Dec 9 18:35:06 CET 2006


// R 2.3.1

Can someone please explain why this error returns?

> y=numeric(100)
> x=matrix(runif(16),4,4)
> for(i in 2:100)
+    {
+     y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])==1)
+    }
Error in rmultinom(n, size, prob) : too few positive probabilities

thx much

ej




More information about the R-help mailing list