Skip to contents

Split grouped data with names. A wrapper around dplyr::group_by() ref: https://github.com/tidyverse/dplyr/issues/4223

Usage

named_group_split(.tbl, ..., keep_order = TRUE)

Arguments

.tbl

a data frame

...

arguments pass to dplyr::group_by()

keep_order

logical, default TRUE, whether to maintain original order of the groups.

Value

a named list

Examples

if (FALSE) {
a <- tibble::tibble(x = 1:5, y = sample(letters[1:5]))
a  %>% named_group_split(y)
a  %>% named_group_split(y , keep_order = FALSE)
}