dt_nest: Fast Nesting

Description Usage Arguments Value Examples

View source: R/nest.R

Description

Quickly nest data tables (similar to dplyr::group_nest()).

Usage

1
dt_nest(dt_, ..., .key = "data")

Arguments

dt_

the data table to nest

...

the variables to group by

.key

the name of the list column; default is "data"

Value

A data.table with a list column containing data.tables

Examples

1
2
3
4
5
6
7
8
library(data.table)
dt <- data.table(
  x = rnorm(1e5),
  y = runif(1e5),
  grp = sample(1L:3L, 1e5, replace = TRUE)
  )

dt_nest(dt, grp)

tidyfast documentation built on March 20, 2020, 5:08 p.m.