[R] generate randomly a value of a vector

Boris Beranger borisberanger at gmail.com
Thu Sep 8 10:42:51 CEST 2011


Hi everyone,

I have a zero vector of length N and I would like to randomly allocate the
value 1 to one of the values of this vector. I presume I have to use the
uniform distribution but could someone tell me how I should process?

Thanks in advance,
Boris

--
View this message in context: http://r.789695.n4.nabble.com/generate-randomly-a-value-of-a-vector-tp3798190p3798190.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list