R is one of the more powerful programming languages for data processing and visualization. Additionally, plenty of users rely on Rstudio’s programming environment to monitor variables and interface with information. However, even experienced programmers are unaware of hacks built into the software. Here, Ravi Bahethi, president of Terranet, Inc. and our collaborator, examines four helpful shortcuts that make coding in R and Rstudio much easier.
1. Take Advantage of Auto-complete
If you are not currently using the auto-complete tab, it is time to make use of this neglected yet essential feature. You can search everything from file names to variable names with the tab key on the keyboard. This way, there is no need to memorize a seemingly endless list of names. If you rely on naming conventions for objects/functions, this hack will prove that much more critical. As an example, if the data frames in your code begin with a couple of letters such as “d.a.”, you can type “da” and hit tab to retrieve relevant object names. The auto-complete function also works for directory locations, file locations, function arguments, and packages.
2. Shortcuts to Enhance Code
If you do not like the look of your code, give these shortcuts a try. Press the control button and “I” on the keyboard to fix problems with line indentation. If you would like to perform a full reformat of the selected portion of code, press control in unison with the shift key and the “A” key on the keyboard.
3. Rstudio’s Dark Theme is Your Friend
Give Rstudio’s dark theme a try, and you will find you are that much more productive. The program’s dark theme will prove especially helpful to those who spend the vast majority of their time in front of a computer screen. Activate the dark theme, and your eyes will no longer feel nearly as strained after a long work session.
Here’s how to alter the Rstudio theme: go to tools, click global options, and click appearance. Select the dark theme you like the best. Once the dark theme is activated, you will immediately notice the screen does not strain your eyes nearly as much as the default theme.
We just sent you an email. Please click the link in the email to confirm your subscription!