dmZooming to a table of a dm allows for the use of many dplyr-verbs directly on this table, while retaining the
context of the dm object.
dm_zoom_to_tbl(dm, table)dm_insert_zoomed_tbl(dm, new_tbl_name = NULL, repair = "unique", quiet = FALSE)
dm_update_zoomed_tbl(dm)
dm_zoom_out(dm)
A dm object.
A table in the dm.
Name of the new table.
Either a string or a function. If a string, it must
be one of "check_unique", "minimal", "unique", or "universal".
If a function, it is invoked with a vector of minimal names and must
return minimal names, otherwise an error is thrown.
Minimal names are never NULL or NA. When an element doesn't
have a name, its minimal name is an empty string.
Unique names are unique. A suffix is appended to duplicate names to make them unique.
Universal names are unique and syntactic, meaning that you can safely use the names as variables without causing a syntax error.
The "check_unique" option doesn't perform any name repair.
Instead, an error is raised if the names don't suit the
"unique" criteria.
By default, the user is informed of any renaming
caused by repairing the names. This only concerns unique and
universal repairing. Set quiet to TRUE to silence the
messages.
dm_zoom_to_tbl(): zooms to the given table.
dm_update_zoomed_tbl(): overwrites the originally zoomed table with the manipulated table.
The filter conditions for the zoomed table are added to the original filter conditions.
dm_insert_zoomed_tbl(): adds a new table to the dm.
dm_zoom_out(): discards the zoomed table and returns the dm as it was before zooming.
Whenever possible, the key relations of the original table are transferred to the resulting table
when using dm_insert_zoomed_tbl() or dm_update_zoomed_tbl().
Functions from dplyr that are supported for a zoomed_dm: group_by(), summarise(), mutate(),
transmute(), filter(), select(), rename() and ungroup().
You can use these functions just like you would
with a normal table.
In addition to filtering the zoomed table, the filter condition from filter() is also stored in the dm.
Depending on which function you use to return to a normal dm, one of the following happens:
dm_zoom_out(): all filter conditions for the zoomed table are discarded
dm_update_zoomed_tbl(): the filter conditions of the original table and those of the zoomed table are combined
dm_insert_zoomed_tbl(): the filter conditions of the original table stay there and those of the zoomed table are
transferred to the new table of the dm
Furthermore, the different join()-variants from dplyr are also supported (apart from nest_join()).
The join-methods for zoomed_dm have an extra argument select that let's you choose the columns of the RHS table
in a tidyselect manner.
And -- last but not least -- also the tidyr-functions unite() and separate() are supported for zoomed_dm.