powered by
data.frame
This function groups a data.frame according to values of one column.
group_data.frame(df, by, keep_by = TRUE)
A list of data.frames, subsets of df.
list
df
[data.frame] A data.frame.
[character(1)] The name of a column of df to group by.
character(1)
[logical(1)] Keep the grouping column by?
logical(1)
by
Other data.frame helpers: delete_columns_data.frame(), round_data.frame()
delete_columns_data.frame()
round_data.frame()
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)
Run the code above in your browser using DataLab