Description Usage Arguments Details Value Examples
Return modified names of object
1 | rename(x, mapping)
|
x |
Object whose |
mapping |
Named character vector whose \"names\" attribute
matches all, some, or none of the names of |
The rename function does not modify x and
thereby avoids potentially expensive copies due to R's
copy-on-modify semantics. Use names<- with
the result of rename to change the names of x in
a non-expensive way.
Note that mapping does not have to contain new values
for all elements of names(x). If an element of
names(x) is not among names(mapping), it will be
unchanged. In particular, if mapping and x have
no names in common, rename will return names(x).
It is an error for names(mapping) to contain duplicate
names. It is okay for mapping to contain a mixture of
named and unnamed elements. Unnamed elements of x will
never be renamed.
Return a character vector that can be used with
names<- to change the names of x.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.