Description Usage Arguments Details Value Examples
This function sets the attributes of the argument to to
match the attributes of from. The special attributes
dim, dimnames, names, and row.names
are skipped to preserve dimensionality. Existing attributes with
the same name are overwritten by default.
1 |
from |
The variable to copy attributes from. |
to |
The variable whose attribute are to be set. |
clobber |
Logical: if true (default), from@att will overwrite to@att. If false, attributes on to take priority. |
Attribute ordering is mostly preserved. After copying, special attributes will come first, in alphabetical order. Attributes of the variable with priority (default: the variable being copied from) come next, in their original order. Any additional attributes (default: the variable being copied to) come last, again in their original order.
This function exists because you can't simply assign
attributes(x) <- attributes(y) if x and y are arrays with
different dimensions. You can avoid this problem by using
mostattributes(x) <- attributes(y) instead, but that
removes any dimensions on x, flattening it to a vector. Like
mostattributes<-, it is principally intended for arrays,
and should be used with care on classed objects.
A copy of to with the attributes of from.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.