[R] Using split and then unsplit

David Winsemius dwinsemius at comcast.net
Mon Apr 19 17:23:40 CEST 2010


On Apr 19, 2010, at 11:06 AM, anna wrote:

>
> Hello everyone,
> I use the split function splitting with the f function on a 3  
> columns and
> more than 100 000 rows data frame. Once it's split I have a list of  
> data
> frames still with 3 columns and n rows. I manipulate those list  
> elements and
> get a list of data frames still with 3 columns but less rows. So  
> when I
> unsplit it, I get an error as I use the same factor function I used  
> to split
> ( f in the help split page) I guess because the number of rows  
> changed. Do I
> need to create a new f function to be able to unsplit or is there  
> another
> way to unsplit those data frames and rbind them? Thank you!

You may get success with:

do.call(rbind, splitted)

The other task to set for yourself is to read the Posting Guide again  
and create test cases when posting to r-help.

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list