View source: R/cpp11.R View source: R/rebuild.R
rebuild | R Documentation |
Rebuild an object from a template
rebuild(x, template, ...)
## S3 method for class 'data.frame'
rebuild(x, template, shallow_copy = TRUE, ...)
## S3 method for class 'data.table'
rebuild(x, template, shallow_copy = TRUE, ...)
x |
An object in which carefully selected attributes
will be copied into from |
template |
A template object used to copy attributes into |
... |
Further arguments passed onto methods. |
shallow_copy |
Should |
In R attributes are difficult to work with. One big reason for this is that attributes may or may not be independent of the data. Date vectors for example have attributes completely independent of the data and hence if the attributes are removed at any point, they can easily be re-added without any calculations. Factors have almost data-independent attributes with an exception being when factors are combined. In some cases it is not possible to rebuild attributes from the data alone.
You can add your own rebuild
method for an object not covered
by the methods here.
An object similar to template
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.