Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

group_split..html

Split data frame by groups


Description

Split data frame by groups. Returns a list.

Usage

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

Arguments

.df

A data.frame or data.table

...

Columns to group and split by. tidyselect compatible.

.keep

Should the grouping columns be kept

.named

Should the list be named with labels that identify the group

Examples

test_df <- tidytable(
  a = 1:3,
  b = 1:3,
  c = c("a","a","b"),
  d = c("a","a","b")
 )

test_df %>%
  group_split.(c, d)

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

test_df %>%
  group_split.(c, d, .named = TRUE)

tidytable

Tidy Interface to 'data.table'

v0.6.1
MIT + file LICENSE
Authors
Mark Fairbanks [aut, cre], Abdessabour Moutik [ctb], Matt Carlson [ctb], Ivan Leung [ctb], Ross Kennedy [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.