groupBy,DataFrame-method {SparkR} | R Documentation |
Groups the DataFrame using the specified columns, so we can run aggregation on them.
## S4 method for signature 'DataFrame' groupBy(x, ...) ## S4 method for signature 'DataFrame' group_by(x, ...) group_by(x, ...)
x |
a DataFrame |
a GroupedData
GroupedData
## Not run:
##D # Compute the average for all numeric columns grouped by department.
##D avg(groupBy(df, "department"))
##D
##D # Compute the max age and average salary, grouped by department and gender.
##D agg(groupBy(df, "department", "gender"), salary="avg", "age" -> "max")
## End(Not run)