copy | R Documentation |
This function copies the given RStatic object, while ensuring that parent-child relationships are preserved for the copied object.
copy(x, ...)
x |
The object to copy. |
... |
Additional arguments to methods. |
skip_set_parent |
(character) Names of fields which should never have
|
If x
is any other R6 object, x
is deep-cloned. If x
is
not an R6 object, no action is taken and x
is returned.
Since RStatic objects are references, assignment does not make a copy. This function can be used to explicitly copy an RStatic object.
set_parent
, which is used by this function.
x = quote_ast(x <- "Hi DTL!")
y = x
z = copy(x)
x$read = Numeric$new(141)
# Changing 'x' changed 'y' (a reference), but not 'z' (a copy).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.