tbl_nest: Nest a tibble by grouping variables and specified other...

tbl_nestR Documentation

Nest a tibble by grouping variables and specified other variables

Description

Nest a tibble by grouping variables and specified other variables

Usage

tbl_nest(
  data,
  grouping_variables = NULL,
  nesting_variables = NULL,
  data_column_name = NULL
)

Arguments

data

a 'tibble'

grouping_variables

vector of variables to group by

nesting_variables

if not 'NULL' vector of other variables to select

data_column_name

if not 'NULL' new nested data column name

Value

'tibble'

Examples


gapminder::gapminder %>%
tbl_nest(grouping_variables = "year",
data_column_name = "ttdata")


gapminder::gapminder %>%
tbl_nest(grouping_variables = c("continent", "country"),
nesting_variables = c("pop", "year"))



abresler/asbtools documentation built on July 28, 2022, 11:04 p.m.