Re: [R] summarizing a data frame i.e. count -> group by

2011-10-23 Thread Dennis Murphy
And the plyr version of this would be (using DF as the data frame name) ## transform method, mapping length(runtime) to all observations ## similar to David's results: library('plyr') ddply(DF, .(time, partitioning_mode), transform, n = length(runtime)) # or equivalently, the newer and somewhat fa

Re: [R] summarizing a data frame i.e. count -> group by

2011-10-23 Thread jim holtman
Another package to consider, especially if your dataframe is large, is 'data.table': > tp <- read.table(textConnection(" time partitioning_mode workload runtime + 1 1 shardingquery 607 + 2 1 shardingquery 85 + 3 1 shardingquery 52 +

Re: [R] summarizing a data frame i.e. count -> group by

2011-10-23 Thread Tyler Rinker
<- cast(df, partitioning_mode + workload~time, value="runtime", length) > From: brave...@gmail.com > Date: Sun, 23 Oct 2011 19:29:40 +0200 > To: r-help@r-project.org > Subject: [R] summarizing a data frame i.e. count -> group by > >

Re: [R] summarizing a data frame i.e. count -> group by

2011-10-23 Thread David Winsemius
On Oct 23, 2011, at 1:29 PM, Giovanni Azua wrote: Hello, This is one problem at the time :) I have a data frame df that looks like this: > df <-read.table(textConnection(" time partitioning_mode workload runtime + 1 1 shardingquery 607 + 2 1 shardingq

[R] summarizing a data frame i.e. count -> group by

2011-10-23 Thread Giovanni Azua
Hello, This is one problem at the time :) I have a data frame df that looks like this: time partitioning_mode workload runtime 1 1 shardingquery 607 2 1 shardingquery 85 3 1 shardingquery 52 4 1 shardingquery