R package supplies a number of substantial programming tools, including the
S4 compatible dot-pipe,
pack object tools, and many more. It also supplies a number of formatting and parsing convenience tools:
qc()(“quoting concatenate”): quotes strings, giving value-oriented interfaces much of the incidental convenience of non-standard evaluation (NSE) interfaces.
: prints maps and vectors as executable code..
let(): allows proper value-oriented programming over non-standard evaluation (NSE) interfaces.
I am excited to share one more such convenience interface:
bc() (“blank concatenate”).
bc() takes a single string argument, parses it, and builds up a vector of the described values.
bc() is easy to demonstrate.
library(wrapr) x <- 1 y <- 2 ls() # result not easy to paste back into R #  "x" "y" # the bc() fix bc('"x" "y"') #  "x" "y" # the map_to_char() fix map_to_char(ls()) #  "c('x', 'y')"
I myself find these solutions a bit more convenient than the usual
bc() requires the outer quotes, but not the internal quotes. That is:
bc('x y') and
bc('x,y') are also equivalent to
And that is some of the tools that make using
R results and error messages to progress on projects by producing new
R code easier. These are small things, but they can help keep one in the flow when working with data. Also, a thank you to Emil Erik Pula Bellamy Begtrup-Bright for suggesting the new functionality.
Data Scientist and trainer at Win Vector LLC. One of the authors of Practical Data Science with R.
Thank you for making it! Also great addition of the use-case where one wants to copy-paste output from the R console back into R.