# NOT RUN {
select_these2 <- function(dat, cols){
select(dat, !!!treat_strings_as_cols(cols))
}
select_these2(mtcars, cols = c("cyl", "wt"))
select_these3 <- function(dat, ...){
dots <- list(...)
select(dat, !!!treat_strings_as_cols(dots))
}
select_these3(mtcars, "cyl", "wt")
select_not_these <- function(dat, cols){
select(dat, -c(!!!treat_strings_as_cols(cols)))
}
select_not_these(mtcars, cols = c("cyl", "wt"))
# }
Run the code above in your browser using DataLab