This website uses cookies to collect usage information in order to offer a better browsing experience. By browsing this site or by clicking on the "ACCEPT COOKIES" button you accept our Cookie Policy.

How can you work faster in R Studio? Do you really want to know?

Console History & History pane

To refresh your knowledge on how to execute and format R code in R Studio, see the previous article in this series.

Everything that you passed to the console doesn’t have to be typed again. Accessing previously executed lines is as easy as navigating with the up and down arrows to cycle between them in chronological order. If you want more visual feedback, you can press Ctrl + Up arrow to get a list of last commands. If you combine it with typing in a part of the searched phrase, you can narrow it down and easily find even complicated commands that are buried deep in the history. It will also override autocomplete popup if it’s active. Note: searching console history doesn’t support fuzzy matching, so you have to be exact. If you want to clear your console, use Ctrl+L, command history will be preserved.

work faster in R Studio

Note: Screenshot of Screencast. Visit Appsilon to see the full demo in R Studio

There is also History pane(4) which stores executed commands. It allows searching. Easily select the ones you need (pick range with shift or gather individual positions with ctrl), then easily insert them back into the console (Enter) or source file (Shift + Enter). The latter helps you avoid copying multiple commands from console to source manually, which is troublesome due to line signs “>” that get copied along and would otherwise have to be removed.

Dealing with Tabs

If you find yourself working on more than one tab in source editor, you might find it helpful to switch between them with Ctrl+Tab and Ctrl+Shift+Tab combinations. It will allow you to jump to the next and previous tab, respectively. There is another way to do this with Ctrl + F11/ F12 if it suits you better. It is also possible to jump to the first or last one by adding Shift to those. Last option that is quite interesting is navigating through tabs in the order they were accessed with Ctrl + F9/F10.

work faster in R Studio

Going through tabs back and forth

Note: Screenshot of Screencast. Visit Appsilon to see the full demo in R Studio

Closing a current tab is easy with Ctrl + w, it is a much better choice than using those small “x” buttons on the right side of your tabs. 

If you get to the point where you have a huge amount of tabs open you can either:

Close All  | Ctrl + Shift + w (+ Alt to keep currently open one),

if you prefer to keep them, you can search through your open tabs with Ctrl + Shift + . (be exact, no fuzzy matching here). This search can also be activated with “>>” icon on tabs bar.

work faster in R Studio

Note: Screenshot of Screencast. Visit Appsilon to see the full demo in R Studio

Above shortcuts are also accessible from the File drop-down menu – this can get in handy while using R studio browser session or simply if you forget them.

About Appsilon  

Our Vision: To discover tomorrow’s applications of data & apply them today. We constantly improve how data is acquired, processed and used. We are driven by using Data Science at the forefront of business, leveraging the potential of the ever increasing amount of data.

Disclosure: Interactive Brokers

Information posted on IBKR Traders’ Insight that is provided by third-parties and not by Interactive Brokers does NOT constitute a recommendation by Interactive Brokers that you should contract for the services of that third party. Third-party participants who contribute to IBKR Traders’ Insight are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.

This material is from Appsilon Data Science and is being posted with permission from Appsilon Data Science. The views expressed in this material are solely those of the author and/or Appsilon Data Science and IBKR is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation to buy, sell or hold such security. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.

trading top