poissonconsulting / tidyplus

An R package of additional tidyverse functions
https://poissonconsulting.github.io/tidyplus/
Other
9 stars 0 forks source link

Create `selecting()` to generate code to select exactly the columns in a data frame. #7

Open joethorley opened 2 years ago

joethorley commented 2 years ago

a great way to say only select informative columns and the convert to code that no longer depends on values (to avoid breakage)

joethorley commented 1 year ago
selecting <- function(.data, ..., .fix = NULL)

selecting(data)

"select(col1, somethingelse, daa, daa2)"

selecting(data, .fix = "'")

"select('col1', 'somethingelse', 'daa', 'daa2')"

selecting(data, matches("^d"), .fix = '"')

'select("daa", "daa2")'