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?
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