Skip to content
Back to formatted view

Raw Message

Message-ID: <5cd96f050612090935m11c5c33dh6aecc611076974d3@mail.gmail.com>
Date: 2006-12-09T17:35:06Z
From: Ethan Johnsons
Subject: Error in rmultinom(n, size, prob) : too few positive probabilities

// 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