Speed up your R programming workflow with RStudio addins and customized keyboard shortcuts Credit: Thinkstock If you want to speed up your R programming workflow, RStudio addins and custom keyboard shortcuts are definitely worth a look. A number of R packages offer add-ins as well as functions, and some are even add-ins only. One of my earliest favorite add-ins, Bare Combine, offers an elegant way to create R character vectors from plain text. 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, Bitbucket and elsewhere if the version you want is somewhere else. You can find add-ins in RStudio’s Addins menu above the upper-left scripts pane. Sharon Machlis/IDG Addins menu in RStudio You can also search for add-ins by using the RStudio command palette, accessible with the keyboard shortcut ctrl-shift-P, or in the Tools > Addins > Browse Addins menu. Bare Combine is part of Bob Rudis’s hrbraddins on Bitbucket. You can install the full package with remotes::install_bitbucket("hrbrmstr/hrbraddins"). A number of add-ins should now be callable from RStudio. If you paste a comma-separated list of words into RStudio such as Chrome, Firefox, Safari, Internet Explorer, Edge, Opera and then highlight it and click on the Bare Combine addin form the menu, the result will be code for a properly formatted R vector: c("Chrome", "Firefox", "Safari", "Internet Explorer", "Edge", "Opera") It even works if the items aren’t comma-separated but are each on a separate line. It’s somewhat cumbersome and time-consuming to scroll through a list of addins, though. Fortunately, you can create a keyboard shortcut for any addin choosing Tools > Modify Keyboard Shortcuts in RStudio. You first see all the built-in possibilities for shortcuts. If you keep scrolling, you eventually see your addins. Or, much easier, you can use the search box to look for your addin. Click into the empty field under the Shortcut column and type your key combination. Here, I chose Ctrl-Alt-C (and next clicked Apply): Sharon Machlis/IDG Adding a custom keyboard shortcut in RStudio Now if I select the text and press Ctrl-Alt-C, my addin works—without having to scroll through my entire addin menu. Dean Attali has a list of RStudio addins on GitHub. It’s worth taking a look at the list; there might be a couple of addins you didn’t know about that will help you speed up your R workflow. Another of my favorites: datapasta by Miles McBain, which lets you copy data into your clipboard and then paste it into RStudio as a data frame. Related content feature What is Rust? Safe, fast, and easy software development Unlike most programming languages, Rust doesn't make you choose between speed, safety, and ease of use. Find out how Rust delivers better code with fewer compromises, and a few downsides to consider before learning Rust. By Serdar Yegulalp Nov 20, 2024 11 mins Rust Programming Languages Software Development how-to Kotlin for Java developers: Classes and coroutines Kotlin was designed to bring more flexibility and flow to programming in the JVM. Here's an in-depth look at how Kotlin makes working with classes and objects easier and introduces coroutines to modernize concurrency. By Matthew Tyson Nov 20, 2024 9 mins Java Kotlin Programming Languages analysis Azure AI Foundry tools for changes in AI applications Microsoft’s launch of Azure AI Foundry at Ignite 2024 signals a welcome shift from chatbots to agents and to using AI for business process automation. By Simon Bisson Nov 20, 2024 7 mins Microsoft Azure Generative AI Development Tools news Microsoft unveils imaging APIs for Windows Copilot Runtime Generative AI-backed APIs will allow developers to build image super resolution, image segmentation, object erase, and OCR capabilities into Windows applications. By Paul Krill Nov 19, 2024 2 mins Generative AI APIs Development Libraries and Frameworks Resources Videos