Skip to content
Prev 275258 / 398503 Next

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

This could be done with aggregate but I am unfamiliar with it so I'll give what I think you want from your message using the library 'reshape' that you'll have to doneload.  If you're problem is large the data.table library would be much faster.
 
You haven't really said what you'd like to get from the output so I'm going by what your code looks like you want. There is no count in R, the function is called length (you may want sum but it does not appear that way).  Also giving the list a bit of what you'd expect for an out put is often helpful.
 
Here is the code(one of these three options is what you want I think:
 
library(reshape)
throughput1 <- cast(df, time~partitioning_mode, value="runtime",  length)
throughput2 <- cast(df, partitioning_mode~time, value="runtime",  length)
throughput3 <- cast(df, partitioning_mode + workload~time, value="runtime", length)

----------------------------------------