search for: tp4647447p4647469

Displaying 1 result from an estimated 1 matches for "tp4647447p4647469".

2012 Oct 25
3
How generate random numbers from given vector???
I wanna generate random numbers from a vector... for example number<-c(0,1,3,4,5,6,8) so rsidp<-function(x){ i=0 for (i in seq(1:x)) {y<-sample(number,x, replace=T)} return(y) } so all random numbers have to be from vector "number"; so if I type rsidp(5)..... it has to give me 5 random numbers except 2,7,9 (because they are not in the vector "numbers"). help