Rename the columns of your dm
using syntax that is similar to dplyr::rename()
.
Arguments
- dm
A
dm
object.- table
A table in the
dm
.- ...
One or more unquoted expressions separated by commas. You can treat variable names as if they were positions, and use expressions like x:y to select the ranges of variables.
Use named arguments, e.g. new_name = old_name, to rename the selected variables.
The arguments in ... are automatically quoted and evaluated in a context where column names represent column positions. They also support unquoting and splicing. See
vignette("programming", package = "dplyr")
for an introduction to those concepts.See select helpers for more details, and the examples about tidyselect helpers, such as starts_with(), everything(), ...
Examples
dm_nycflights13() %>%
dm_rename(airports, code = faa, altitude = alt)
#> ── Metadata ────────────────────────────────────────────────────────────────────
#> Tables: `airlines`, `airports`, `flights`, `planes`, `weather`
#> Columns: 53
#> Primary keys: 4
#> Foreign keys: 4