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

df_nest_by

Nest a Tibble By Groups


Description

Nest a tibble data frame using grouping specification. Supports standard and non standard evaluation.

Usage

df_nest_by(data, ..., vars = NULL)

Arguments

data

a data frame

...

One or more unquoted expressions (or variable names) separated by commas. Used as grouping variables.

vars

a character vector containing the grouping variables of interest.

Value

A tbl with one row per unique combination of the grouping variables. The first columns are the grouping variables, followed by a list column of tibbles with matching rows of the remaining columns.

Examples

# Non standard evaluation
ToothGrowth %>%
 df_nest_by(dose, supp)

# Standard evaluation
ToothGrowth %>%
 df_nest_by(vars = c("dose", "supp"))

rstatix

Pipe-Friendly Framework for Basic Statistical Tests

v0.7.0
GPL-2
Authors
Alboukadel Kassambara [aut, cre]
Initial release

We don't support your browser anymore

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