dm
dm_paste
takes an existing dm
and produces the code necessary for its creation
dm_paste(dm, select = FALSE, tab_width = 2)
A dm
object.
Boolean, default FALSE
. If TRUE
will try to produce code for reducing to necessary columns.
Indentation width for code from the second line onwards
Code for producing the given dm
.
At the very least (if no keys exist in the given dm
) a dm()
statement is produced that -- when executed --
produces the same dm
. In addition, the code for setting the existing primary keys as well as the relations between the
tables is produced. If select = TRUE
, statements are included to select the respective columns of each table of the dm
(useful if
only a subset of the columns of the original tables is used for the dm
).
Mind, that it is assumed, that the tables of the existing dm
are available in the global environment under their names
within the dm
.