Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-13 Thread hadley wickham
On Tue, Oct 13, 2009 at 6:57 AM, Ista Zahn wrote: > I'm sure there's a really cool way to do this with plyr, although I > don't know if my particular plyr version is much better. Anyway here > it is: > > cmbine <- read.csv(textConnection('names, mass, classes > apple,0.50,1 > tiger,100.00,2 > penc

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-13 Thread Ista Zahn
I'm sure there's a really cool way to do this with plyr, although I don't know if my particular plyr version is much better. Anyway here it is: cmbine <- read.csv(textConnection('names, mass, classes apple,0.50,1 tiger,100.00,2 pencil,0.01,3 chicken,1.00,2 banana,0.15,1 pear,0.30,1')) library(ply

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread cls59
wk yeo wrote: > > > Hi, all, > > My objective is to split a dataframe named "cmbine" according to the value > of "classes". After the split, I will take the first instance from each > class and bin them into a new dataframe, "df1". In the 2nd iteration, I > will take the 2nd available instanc

Re: [R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread cls59
wk yeo wrote: > > > Hi, all, > > My objective is to split a dataframe named "cmbine" according to the value > of "classes". After the split, I will take the first instance from each > class and bin them into a new dataframe, "df1". In the 2nd iteration, I > will take the 2nd available instanc

[R] splitting dataframe, assign to new dataframe, add new rows to new dataframe

2009-10-12 Thread wk y
Hi, all, My objective is to split a dataframe named "cmbine" according to the value of "classes". After the split, I will take the first instance from each class and bin them into a new dataframe, "df1". In the 2nd iteration, I will take the 2nd available instance and bin them into another new