tidyeval
tidyeval copied to clipboard
How can we take inputs that should strictly be column names?
-
ensyms()not appropriate as the symbols will still be looked up inside the execution env of the user's wrapper, all the way up to the search path. -
Do we need
envars()? If user supplies symbolsfooandbar, they get quoted as.data$fooand.data$bar. If a call is supplied, a helpful error is issued. -
Other approach:
enstrings()as a shortcut formap_chr(ensyms(...), as_string)and providing a tidyselect function to check existence of names in data frame. r-lib/tidyselect#85. The advantage of this approach is that the user can continue working with names as strings, which is sometimes needed (programmatically creating new columns etc).