We will now talk about various features of the R console in this section.
The most direct way to work with R is by entering commands straight in the console. When RStudio is started for the first time, its interface to the R console is on the left-hand side. The console window has three buttons on its top bar. On the right-hand side, there are two buttons that minimize or maximize the command window. On the left-hand side, just after the word Console, the current working directory is shown. On the right-hand side is an arrow that, when clicked, opens the file browser on the right-hand side to view RStudio's current working directory.
To execute a command from the console, type it after the prompt (the >
symbol) and press Enter. The command is sent to the R engine, executed, and printed back to the screen in a different color. This is the first example of what is called
syntax highlighting to which we will return extensively in the next subsection...