Skip to content
Prev 17733 / 398502 Next

? about sample

On Fri, 8 Mar 2002, jimi adams wrote:

            
It sounds like you want to add replace=TRUE, eg

R> sample(1:4,prob=c(0,0,1,0),replace=TRUE)
[1] 3 3 3 3

You were trying to sample four numbers without replacement from a set
effectively containing only one number.  That's what the error message
means.

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._