nest.: Nest data.tables

Description Usage Arguments Examples

View source: R/nest.R

Description

Nest data.tables

Usage

1
nest.(.df, ..., .names_sep = NULL)

Arguments

.df

A data.table or data.frame

...

Columns to be nested.

.names_sep

If NULL, the names will be left alone. If a string, the names of the columns will be created by pasting together the inner column names and the outer column names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
test_df <- data.table(
  a = 1:10,
  b = 11:20,
  c = c(rep("a", 6), rep("b", 4)),
  d = c(rep("a", 4), rep("b", 6))
)

test_df %>%
  nest.(data = c(a, b))

test_df %>%
  nest.(data = where(is.numeric))

mtfairbanks/gdt documentation built on May 4, 2021, 9:44 a.m.