select_variables: Select variables in a dataframe.

Description Arguments Examples

Description

Select variables in a dataframe.

Arguments

dataframe

a data.frame

cols

an atomic vector. Drop all but these columns.

weak

logical. Whether or not to add non-existent columns as NAs.

Examples

1
2
3
df <- iris; select_variables()$run(df, 1) # Select only first variable
df <- iris; select_variables()$run(df, c('Sepal.Length', 'Petal.Length'))
df <- iris; select_variables()$run(df, c(TRUE,TRUE,FALSE,FALSE,TRUE)) # Exclude cols 3 and 4

syberia/syberiaMungebits2 documentation built on May 30, 2019, 10:42 p.m.