rename {tidybulk} | R Documentation

## Rename columns

### Description

Rename individual variables using 'new_name = old_name' syntax.

### Usage

    rename(.data, ...)

### Arguments

`.data` | A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See *Methods*, below, for more details.
`...` | <['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

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

[Package tidybulk version 0.99.23 Index]