List-columns in data.table
summary
Shows how to create and use list-columns in data.table to nest and unnest real examples (Star Wars characters with a per‑film revenue table), using the by argument, .SD and := (the walrus operator) plus purrr::map() to build per‑group list columns, then join and unnest back out. Bench::mark() comparisons to dplyr::group_nest() and tidyr::unnest() report lower memory use and faster runs as data and group count grows. A tiny R package tidyfast collects the helpers; use as.data.table vs setDT for copies.
AI-written summary · about
chapters (5)
related talks
44mNeed for speed: the data manipulation version
05mdplyr 1.1.0 Features You Can't Live Without
20mGive me the Data
18mduckplyr: Analyze large data with full dplyr compatibility
51mDataFrame: Kotlin's Innovative Approach to Data Structures
18mdbtplyr: Bringing Column-Name Contracts from R to dbt
05mWhy tidy data matters
37mBenefits of columnar data layout
