Learn R Programming

tidytable (version 0.5.9)

group_split.: Split data frame by groups

Description

Split data frame by groups. Returns a list.

Usage

group_split.(.df, ..., .keep = TRUE)

Arguments

.df

A data.frame or data.table

...

Columns to group and split by. tidyselect compatible.

.keep

Should the grouping columns be kept

Examples

Run this code
# NOT RUN {
test_df <- tidytable(
  a = 1:5,
  b = 1:5,
  c = c("a","a","a","b","b"),
  d = c("a","a","a","b","b"))

test_df %>%
  group_split.(c, d)

test_df %>%
  group_split.(c, d, .keep = FALSE)
# }

Run the code above in your browser using DataLab