[R] sampling
yf
chang648 at umn.edu
Thu Feb 17 05:35:12 CET 2011
I want to sample from the ID. For each ID, i want to have 2 set of data. I
try the sample() function but it didn't work.
> x<-data.frame(id=c(1,1,1,2,2,2,2,3,3,3,4,4), v1=c(1:12), V2=c(12:23))
> x
id v1 V2
1 1 1 12
2 1 2 13
3 1 3 14
4 2 4 15
5 2 5 16
6 2 6 17
7 2 7 18
8 3 8 19
9 3 9 20
10 3 10 21
11 4 11 22
12 4 12 23
--
View this message in context: http://r.789695.n4.nabble.com/sampling-tp3310184p3310184.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list