Andras Farkas via R-help <r-help@r-project.org> writes:

Hello,

 set.seed(123.456)
 
 df <-data.frame(ID=c(1,1,2,2,2,3,3,3,3,4,4,5,5),
 read=c(1,1,0,1,1,1,0,0,0,1,0,0,0),
 int=c(1,1,0,0,0,1,1,0,0,1,1,1,1),
 z=rnorm(13,1,5),
 y=rnorm(13,1,5))

May this will suffice?

lapply(unique(df$ID),function(x) df[df$ID==x,])



HTH,

Jeremie

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to