treat_inputs_as_cols: treat_inputs_as_cols

Description Usage Arguments Details Value Examples

Description

Take the literal text input for a comma separated list of arguments and treat it as list of column names in a dplyr function.

Usage

1

Arguments

...

a comma separated list of arguments to be treated as column names.

Details

The most common usage of this is to pass '...', from your function directly through to dplyr functions as column names, as in the 'select_these' example.

This function must be prefixed with '!!!' to treat the output as a list.

Value

something that will resolve to a list of column names when prefixed with '!!!'

Examples

1
2
3
4
5
6
7
## Not run: 
select_these <- function(dat, ...){
 select(dat, !!!treat_inputs_as_cols(...))
}
select_these(mtcars, cyl, wt)

## End(Not run)

MilesMcBain/rlung documentation built on May 21, 2019, 9:22 a.m.