dm (version 0.0.3.9003)

cdm_select: Select and/or rename one or more columns of a dm table

Description

Select columns of your dm with a similar syntax to dplyr::select().

Usage

cdm_select(dm, table, ...)

Arguments

dm

A dm object.

table

A table in the dm

...

One or more unquoted expressions separated by commas. You can treat variable names like they are positions, so you can use expressions like x:y to select ranges of variables.

Use named arguments, e.g. new_name = old_name, to rename 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 these concepts.

See select helpers for more details and examples about tidyselect helpers such as starts_with(), everything(), ...

Details

If key columns are renamed the meta-information of the dm is updated accordingly. If key columns would be removed, cdm_select() makes sure they are re-added to the table.

Examples

Run this code
# NOT RUN {
cdm_nycflights13() %>%
  cdm_select(airports, code = faa, altitude = alt)
# }

Run the code above in your browser using DataLab