R users typically work in RStudio. This IDE (Integrated Developer Environment) integrates with the basic R software to offer a more-accessible interface for everything from writing code to installing packages. If someone says they use R, they probably run RStudio as they program in the R language.
With the default RStudio layout, coding happens in the pane along the left.
The Console lets you type code and run it line-by-line. Code runs when you press the Enter key. Code you've run appears here as a continuous log with any printed output.
The Console gets cleared when R closes and starts fresh with the next session. This is great if you just need to run a line of code once, in the moment--like opening Help (?) to see how a function works. Store content you want to save outside of the Console.
Code you want to develop or save goes in the code file (above the Console).
Run the current line or a selected chunk of code by pressing Ctrl+Enter, or Click the relevant run button (green arrow icons).
Running code from the code file automatically enters it in the Console without affecting the code file. Save your code for later by using the file menu or disk icons.
Depending on its design, an R function may print a result in the Console, change an aspect of your system, or generate output that doesn't appear in the Console.
If you create an object by assigning data to a name (e.g.: name <- 1; dat <- c(1:5)), the object appears in the Environment in the upper right pane. Use any object stored in the Environment by typing its name in your code.
If you open Help or visualize your data, the result appears in the lower right pane.