[R] subsampling

nicolas.deig@epfl.ch nicolas.deig at epfl.ch
Fri Jan 14 17:23:33 CET 2005


hi,

I would like to subsample the array c(1:200) at random into ten subsamples 
v1,v2,...,v10.

I tried with to go progressively like this:


> x<-c(1:200)
> v1<-sample(x,20)
> y<-x[-v1]
> v2<-sample(y,20)

and then I want to do:

>x<-y[-v2]
Error: subscript out of bounds.




More information about the R-help mailing list