dm_wrap_tbl {dm} | R Documentation |
Wrap dm into a single tibble dm
Description
dm_wrap_tbl()
creates a single tibble dm containing the root
table
enhanced with all the data related to it
through the relationships stored in the dm.
It runs a sequence of dm_nest_tbl()
and dm_pack_tbl()
operations
on the dm.
Usage
dm_wrap_tbl(dm, root, strict = TRUE, progress = NA)
Arguments
dm |
A cycle free dm object. |
root |
Table to wrap the dm into (unquoted). |
strict |
Whether to fail for cyclic dms that cannot be wrapped into a
single table, if |
progress |
Whether to display a progress bar, if |
Details
dm_wrap_tbl()
is an inverse to dm_unwrap_tbl()
,
i.e., wrapping after unwrapping returns the same information
(disregarding row and column order).
The opposite is not generally true:
since dm_wrap_tbl()
keeps only rows related directly or indirectly to
rows in the root
table.
Even if all referential constraints are satisfied,
unwrapping after wrapping loses rows in parent tables
that don't have a corresponding row in the child table.
This function differs from dm_flatten_to_tbl()
and dm_squash_to_tbl()
,
which always return a single table, and not a dm
object.
Value
A dm
object.
See Also
dm_unwrap_tbl()
, dm_nest_tbl()
,
dm_examine_constraints()
,
dm_examine_cardinalities()
.
Examples
dm_nycflights13() %>%
dm_wrap_tbl(root = airlines)