for each group summarise means for all variables in dataframe(ddply? split?)

for each group summarise means for all variables in dataframe(ddply? split?)

A week ago I would have done this manually: subset dataframe by group to new dataframes. For each dataframe compute means for each variables, then rbind. very clunky... Now i have learned about spl…


Is there an implementation of Hadley's ddply for python?

I find Hadley's plyr package for R extremely helpful, its a great DSL for transforming data. The problem that is solves is so common, that I face it other use cases, when not manipulating data in R, b…


Correcting “summary” in R with appropriate#of digits of precision

A simple question on a simple seemingly innocent function: summary. Until I saw results for Min and Max that were outside the range of my data, I was unaware that summary has a digits argument to sp…


Group by multiple columns in dplyr, using string vector input

I'm trying to transfer my understanding of plyr into dplyr, but I can't figure out how to group by multiple columns.#make data with weird column names that can't be hard coded data=data.frame( a…


Can dplyr summarise over several variables without listing each one?

This question already has an answer here: Aggregate/summarize multiple variables per group(e.g. sum, mean) 4 answers dplyr is amazingly fast, but I won…


all.equal on object with NULL names causes 'Error: not compatible with STRSXP' — bug or expected?

In the example below, when names are set to NULL, all.equal throws 'Error: not compatible with STRSXP' However, if names are set to NA(or some other value), all.equal works as normal. Is this expecte…



Return a list in dplyr mutate()

I have a function in my real-world problem that returns a list. Is there any way to use this with the dplyr mutate()? This toy example doesn't work-: it=data.table(c("a","a","b","b","c"),c(1,2,3,4,…


Summarizing multiple columns with dplyr?

This question already has an answer here: Aggregate/summarize multiple variables per group(e.g. sum, mean) 5 answers Can dplyr summarise over several va…


dplyr: How to apply do() on result of group_by?

I'd like to use dplyr to group a table by one column, then apply a function to the set of values in the second column of each group. For instance, in the code example below, I'd like to return all of…


dplyr summarise() with multiple return values from a single function

I am wondering if there is a way to use functions with summarise(dplyr 0.1.2) that return multiple values(for instance the describe function from psych package). If not, is it just because it hasn't…




dplyr group columns multiple count data sum sheet keep cheat