Not sure what you mean by "group index" but try: 

lapply(df.s,function(l){l$x})
or something like: 

do.call("rbind",df.s) 

to convert the result into a data.frame. 

Regards

Wayne



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Rick DeShon
Sent: 14 September 2007 11:50
To: [EMAIL PROTECTED]
Subject: [R] How to remove index from list after split?


In the following example, how can I drop the group index from the list after
I perform a split?
n     <- 3
nn   <- 10
g     <- factor(round(n * runif(n * nn)))
x     <- rnorm(n * nn) + sqrt(as.numeric(g))
df    <- data.frame(g,x)
df.s <- split(df,g)

Thanks!

Rick DeShon

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.

______________________________________________
R-help@r-project.org mailing list
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