dt_unnest: Unnest: Fast Unnesting of Data Tables

Description Usage Arguments Examples

View source: R/unnest.R

Description

Quickly unnest data tables, particularly those nested by dt_nest().

Usage

1
dt_unnest(dt_, col, ...)

Arguments

dt_

the data table to unnest

col

the column to unnest

...

any of the other variables in the nested table that you want to keep in the unnested table. Bare variable names. If none are provided, all variables are kept.

Examples

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

nested <- dt_nest(dt, grp)
dt_unnest(nested, col = data)

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