grouped_list: Split dataframe into a list by grouping variable.

View source: R/utils.R

grouped_listR Documentation

Split dataframe into a list by grouping variable.

Description

This function splits the data frame into a list, with the length of the list equal to the factor levels of the grouping variable. Each element of the list will be a tibble.

Usage

grouped_list(data, grouping.var = NULL)

Arguments

data

A data frame (or a tibble) from which variables specified are to be taken. Other data types (e.g., matrix,table, array, etc.) will not be accepted. Additionally, grouped data frames from {dplyr} should be ungrouped before they are entered as data.

grouping.var

A single grouping variable.

Examples


ggstatsplot:::grouped_list(ggplot2::msleep, grouping.var = vore)


ggstatsplot documentation built on May 21, 2022, 5:05 p.m.