[R] error in using sample( )

jxia at math.ucdavis.edu jxia at math.ucdavis.edu
Thu Feb 18 16:48:41 CET 2010


Hi,

I am using the command

>sample(c(0,1,2),1,prob=c(0.2,0.3,0.5))

and I have this error notification

"Error in sample(c(0,1,2),1,prob=c(0.2,0.3,0.5)):
 unused argument(s)(1,prob=c(0.2,0.3,0.5))

I don't know what is going wrong. Please give me some suggestions.

Thank you


Best,
Jing



More information about the R-help mailing list