group_data.frame: Grouping of a 'data.frame'

View source: R/group_data.frame.R

group_data.frameR Documentation

Grouping of a data.frame

Description

This function groups a data.frame according to values of one column.

Usage

group_data.frame(df, by, keep_by = TRUE)

Arguments

df

[data.frame]
A data.frame.

by

[character(1)]
The name of a column of df to group by.

keep_by

[logical(1)]
Keep the grouping column by?

Value

A list of data.frames, subsets of df.

See Also

Other data.frame helpers: delete_columns_data.frame(), round_data.frame()

Examples

df <- data.frame("label" = c("A", "B"), "number" = 1:10)
group_data.frame(df = df, by = "label")
group_data.frame(df = df, by = "label", keep_by = FALSE)

oeli documentation built on Oct. 16, 2024, 5:08 p.m.