Do more with R: RStudio addins and keyboard shortcuts


If you wish to accelerate your R programs workflow, RStudio addins and custom keyboard shortcuts are certainly worth a look. A number of R bundles use add-ins as well as functions, and some are even add-ins only.One of my earliest preferred add-ins, Bare Integrate, uses a stylish method to create R character vectors from plain text.Let’s say I’ve got text with the names of … anything that I want to turn into an R vector. Adding quote marks around each product will quickly get frustrating if there are more than a number of entries. Hence the problem that Bare Combine aims to solve.You install addins the exact same way you install plans with install.packages ()if they’re on CRAN, or whatever plan and function you utilize to install from GitHub, Bitbucket and in other places 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 look for add-ins by

utilizing the RStudio

command scheme, 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 bundle with remotes:: install_bitbucket(“hrbrmstr/hrbraddins”). A number of add-ins need to now be callable from RStudio.If you paste a comma-separated list of words into RStudio such as Chrome, Firefox, Safari, Web Explorer, Edge, Opera and after that highlight it and click on

the Bare Integrate addin type the menu, the result will be code for an appropriately formatted R vector: c(“Chrome”, “Firefox”,”

Safari”, “Internet Explorer”,”Edge “,” Opera “)It even works if the products aren’t comma-separated however are each on a separate line.It’s rather cumbersome and lengthy to scroll through a list of addins, however. Fortunately, you can create a keyboard shortcut for any addin choosing Tools > Modify Keyboard Shortcuts in RStudio. You initially see all the built-in possibilities for faster ways. If you keep scrolling, you eventually see your addins. Or, a lot easier, you can utilize the search box to look for your addin. Click into the empty field under the Faster way column and type your essential combination. Here, I picked Ctrl-Alt-C(and next clicked Apply):< img alt= "RStudio custom-made keyboard shortcut"width= "700 "height ="490 "src =",70"/ > Sharon Machlis/IDGRStudio custom keyboard shortcut Adding a custom keyboard shortcut in RStudio Now if I choose the text and press Ctrl-Alt-C, my addin works– without having to scroll through my whole addin menu.Dean Attali has a list of RStudio addins on GitHub.

It’s worth taking a look at the list; there may be a couple

of addins you didn’t understand about that will assist you accelerate your R workflow. Another of my favorites: datapasta by Miles McBain, which lets you copy information into your clipboard and then paste it into RStudio as an information frame. Copyright © 2023 IDG Communications, Inc. Source

Leave a Reply

Your email address will not be published. Required fields are marked *