View source: R/transferAttributes.r
transferAttributes | R Documentation |
Function allows to copy the attributes of (a subset of) common variables from an origin data.frame to a target data.frame.
transferAttributes(origin, target, whichVars = NULL, whichAttrs = NULL)
origin |
the data.frame from which the attributes should be copied. |
target |
the target data.frame to which the attributes should be copied. |
whichVars |
Optional: character vector of variables which attributes should
be copied. If |
whichAttrs |
Optional: character vector of attributes which should be copied.
If |
The target data.frame with additional attributes
mtcars2 <- mtcars
attr(mtcars[,"cyl"], "varLabel") <- "Number of cylinders"
mtcars2 <- transferAttributes(mtcars, mtcars2, whichVars = "cyl", whichAttrs="varLabel")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.