rename-methods: Rename columns

renameR Documentation

Rename columns

Description

Rename individual variables using 'new_name = old_name' syntax.

Arguments

.data

A tbl. (See dplyr)

...

<['tidy-select'][dplyr_tidy_select]> Use 'new_name = old_name' to rename selected variables.

Value

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.

Scoped selection and renaming

Use the three scoped variants ([rename_all()], [rename_if()], [rename_at()]) to renaming a set of variables with a function.

Methods

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:

See Also

Other single table verbs: arrange(), filter(), mutate(), summarise()

Examples


iris <- as_tibble(iris) # so it prints a little nicer
rename(iris, petal_length = Petal.Length)


stemangiola/tidybulk documentation built on April 9, 2024, 4:16 a.m.