If you want to speed up your R programming workflow, RStudio addins and custom keyboard shortcuts are definitely worth a look. One of my favorites, bare combine, offers an elegant way to create R character vectors from plain text. Here’s how.

Let’s say I’ve got text with the names of … anything that I’d like to turn into an R vector. Adding quotation marks around each item will quickly get annoying if there are more than a couple of entries. Hence the problem that bare combine aims to solve.

[ Get Sharon Machlis’s R tips in our how-to video series. | Read the InfoWorld tutorials: Learn to crunch big data with R. • How to reshape data in R. • R data manipulation tricks at your fingertips • Beginner’s guide to R. | Stay up to date on analytics and big data with the InfoWorld Big Data Report newsletter. ]

You install addins the same way you install packages: with install.packages if they’re on CRAN, or whatever package and function you use to install from GitHub if they’re on GitHub. Bare combine is part of Bob Rudis’s hrbraddins on GitHub, so you can install it with remotes::install_github("hrbrmstr/hrbraddins").

To read this article in full, please click here