dt_nest: Fast Nesting

View source: R/nest.R

dt_nestR Documentation

Fast Nesting

Description

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

Usage

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


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

dt_nest(dt, grp)

TysonStanley/tidyfast documentation built on April 10, 2024, 9:20 a.m.