RStudio addins and keyboard shortcuts

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.

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").

Instead of installing a package that adds new functions, the hrbraddins package gives you several RStudio addins. You’ll find them in RStudio’s Addins menu above the upper-left scripts pane.

Addins menu

If you paste a comma-separated list of words into RStudio such as

Chrome, Firefox, Safari, Internet Explorer, Edge, Opera

You might also like More from author

Leave A Reply

Your email address will not be published.