19.5 Setting preferences

Retain sanity while troubleshooting

  • Open R Studio and go to the file menu go to Tools then Global Options.
  • Uncheck “Restore .RData into workspace at startup”
  • Where it says “Save workspace to .RData on exit:” Select “Never””
  • Click apply then ok to close that window.

This will ensure that when you restart R you do not “carry forward” objects such as data sets that you were working on in a prior assignment.

Restarting R

To effectively restart R, go to the file menu and click Session , then “Restart R”, or “Restart R and clear output”.

R Studio Color Themes

  • Open R Studio and go to the file menu go to Tools then Global Options.
  • Left side under Appearance you have options to change the program window itself, but the best options are down under the Editor themes.
    • If you choose a dark editor theme then choose the Modern program theme to get a fully dark themed program.

Show Output Preview

R Markdown and Quarto documents will default to showing your output (code and graphics) in the code editor window itself. The default is to minimize the console window when executing code, since the output is in the editor window.

Pro: You are only dealing with one main window where you can see your output directly under the code that created it

Con: The output does not auto-regenerate or auto-update when your code or data changes. This can lead to mistakes because if you change code or data and don’t re-run code chunks that contain output or plots, you could be looking at old/incorrect plots and output.