Reputation: 1153
I am constantly typing into the edit window of RStudio after my code completes execution, when my intention is to provide some input in the console window. Is there R code that could be executed that would automatically move the focus to the console window of RStudio?
Upvotes: 7
Views: 2197
Reputation: 615
If you don't look for a shortcut but for code, RStudio has the following command
rstudioapi::executeCommand('activateConsole')
See also RStudio IDE Commands
Upvotes: 4
Reputation: 6073
In RStudio, go to the menu: Tools > Global Settings. In Global Settings, choose "Code" on the left and check the box that says "Focus console after executing from source."
If you don't want to change this global option, these keyboard shortcuts can make switching between the console and editor in RStudio much faster:
In addition, Alt+Shift+k brings up a list of most keyboard shortcuts
Upvotes: 9