Learn R Programming

m61r (version 0.0.3)

group_by: group_by a data.frame by chosen columns

Description

Group a data.frame by chosen columns

Usage

group_by_(df, group = NULL)

Arguments

df

data.frame

group

formula that describes the group

Value

The function returns a list. Each element of the list is a subset of data frame df. Subset is determined by variables given in group. Each data frame get the following properties:

  • Columns are not modified.

  • Only rows corresponding to the subset.

  • Data frame attributes are preserved.

Examples

Run this code
# NOT RUN {
tmp <- group_by_(CO2,~c(Type,Treatment))

tmp[[1]]
# }

Run the code above in your browser using DataLab