rename | R Documentation |
Rename individual variables using 'new_name = old_name' syntax.
.data |
A tbl. (See dplyr) |
... |
<['tidy-select'][dplyr_tidy_select]> Use 'new_name = old_name' to rename selected variables. |
An object of the same type as '.data'. * Rows are not affected. * Column names are changed; column order is preserved * Data frame attributes are preserved. * Groups are updated to reflect new names.
Use the three scoped variants ([rename_all()], [rename_if()], [rename_at()]) to renaming a set of variables with a function.
This function is a **generic**, which means that packages can provide implementations (methods) for other classes. See the documentation of individual methods for extra arguments and differences in behaviour.
The following methods are currently available in loaded packages:
Other single table verbs:
arrange()
,
filter()
,
mutate()
,
summarise()
iris <- as_tibble(iris) # so it prints a little nicer
rename(iris, petal_length = Petal.Length)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.