The console is where you interact with R. R code can be sent through a selection from an R file using CTRL+R or CTRL+Enter, or by writting it directly in the console.
The console is designed to be as simple as possible:
- Works with 3 colors: blue (input), black (output) and red (error) ;
- No autocompletion.
Some information messages are sent by R / Python with the error channel and then printed in red in the console of RCode, even if there is no error. For example in R, when loading some packages, or in Python, the welcome message.
On the top right menu, there are the following actions:
- Restart: starts a new session of R / Python ;
- Clear console (CTRL+L for R console): clears the output of the console ;
- Stop current command (CTRL+Q): only for R console, stops the current execution of R code (for example, stopping an infinite loop) ;
- Source a file for selecting an R / Python file to execute ;
- Set working directory for selecting a new working directory, which is displayed at the top of the corresponding console.
On the top right menu of RCode, Code -> Quick RData save will save the current R session, whereas R -> Quick RData load will load the R session saved. Theses features are accessible with the shortcuts at the top right of RCode if the R language has beed selected (no equivalent for Python).
When testing something that changes the R environment, you can quick save before, do the tests, and reload the environment at the previous state.