set_names | R Documentation |
Sets the names (or colnames) of x
to nm
.
If nm
is a function, it is used to transform the already existing names of x
.
set_names(x, nm = x, ...)
set_col_names(x, nm, ...)
x |
( |
nm |
( |
... |
( |
x
with updated names.
x = letters[1:3]
# name x with itself:
x = set_names(x)
print(x)
# convert names to uppercase
x = set_names(x, toupper)
print(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.