dm_nest_tbl: Nest a table inside its dm

View source: R/dm_nest_tbl.R

dm_nest_tblR Documentation

Nest a table inside its dm

Description

[Experimental]

dm_nest_tbl() converts a child table to a nested column in its parent table. The child table should not have children itself (i.e. it needs to be a terminal child table).

Usage

dm_nest_tbl(dm, child_table, into = NULL)

Arguments

dm

A dm.

child_table

A terminal table with one parent table.

into

The table to nest child_tables into, optional as it can be guessed from the foreign keys unambiguously but useful to be explicit.

See Also

dm_wrap_tbl(), dm_unwrap_tbl(), dm_pack_tbl()

Examples

nested_dm <-
  dm_nycflights13() %>%
  dm_select_tbl(airlines, flights) %>%
  dm_nest_tbl(flights)

nested_dm

nested_dm$airlines

dm documentation built on Nov. 2, 2023, 6:07 p.m.