dm_unwrap_tbl {dm}R Documentation

Unwrap a single table dm

Description

[Experimental]

dm_unwrap_tbl() unwraps all tables in a dm object so that the resulting dm matches a given ptype dm. It runs a sequence of dm_unnest_tbl() and dm_unpack_tbl() operations on the dm.

Usage

dm_unwrap_tbl(dm, ptype, progress = NA)

Arguments

dm

A dm.

ptype

A dm, only used to query names of primary and foreign keys.

progress

Whether to display a progress bar, if NA (the default) hide in non-interactive mode, show in interactive mode. Requires the 'progress' package.

Value

A dm.

See Also

dm_wrap_tbl(), dm_unnest_tbl(), dm_examine_constraints(), dm_examine_cardinalities(), dm_ptype().

Examples


roundtrip <-
  dm_nycflights13() %>%
  dm_wrap_tbl(root = flights) %>%
  dm_unwrap_tbl(ptype = dm_ptype(dm_nycflights13()))
roundtrip

# The roundtrip has the same structure but fewer rows:
dm_nrow(dm_nycflights13())
dm_nrow(roundtrip)

[Package dm version 1.0.10 Index]