Displaying 1 result from an estimated 1 matches for "gpvar".
Did you mean:
gpar
2011 Feb 24
1
split the data
x<-data.frame(id=c(1,1,2,2,3,3,4,4), v1=c(1:8), V2=c(9:16))
> x
id v1 V2
1 1 1 9
2 1 2 10
3 2 3 11
4 2 4 12
5 3 5 13
6 3 6 14
7 4 7 15
8 4 8 16
1)
I want to split the data into 2 group with one unique ID. I should use the
split function but i don't know how to write it out.
2)
I tried to random select the one unique case so I have one group.
id v1 V2
2 1 2