dm_unnest_tbl()
target a specific column to unnest
from the given table in a given dm.
A ptype or a set of keys should be given, not both.
Details
dm_nest_tbl()
is an inverse operation to dm_unnest_tbl()
if differences in row and column order are ignored.
The opposite is true if referential constraints between both tables
are satisfied.
Examples
airlines_wrapped <-
dm_nycflights13() %>%
dm_wrap_tbl(airlines)
# The ptype is required for reconstruction.
# It can be an empty dm, only primary and foreign keys are considered.
ptype <- dm_ptype(dm_nycflights13())
airlines_wrapped %>%
dm_unnest_tbl(airlines, flights, ptype)
#> ── Metadata ────────────────────────────────────────────────────────────────────
#> Tables: `airlines`, `flights`
#> Columns: 24
#> Primary keys: 1
#> Foreign keys: 1