[R] subsetting objects

2003-10-09 Thread Jean Eid
I want to be able to exctract a matrix from a data frame that contains repeated measurements for individuals. i.e I want to exctract the second observation for each individual in the study. Is there a way of doing this? I guess what I am trying to ask is if there as a multidimensional version

RE: [R] subsetting objects

2003-10-09 Thread Gabor Grothendieck
test - data.frame(ID=c(1,1,1,2,2,2),data=1:6) do.call(rbind, by(test,test$ID,function(x)x[2,]) ) --- On Thu 10/09, Jean Eid [EMAIL PROTECTED] wrote: From: Jean Eid [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Thu, 9 Oct 2003 16:06:12 -0400 Subject: [R] subsetting objects I want