4.2 The R console

The R console (bottom-left panel) is where the magic happens!

It is where the user/programmer/you interacts with R.

Let’s try.

Type (or copy-paste) the following in the console (bottom-left panel), and hit the Enter/Return key: return key 1 return key 2

getwd()
  • getwd() is a function. Remember that functions are followed by parenthesis/round brackets.

  • Clicking Enter/Return sends the function to the R kernel and executes/interprets the function.

  • R returns the response/result after the function has completed.

getwd() retrieves and outputs your current working directory/path (we will explain paths in the next section).

Let’s try again.

Copy-paste the following, and hit Enter/Return:

7*3

R gives you the results of this simple multiplication.

USEFUL TIP

In the console, press the keyboard up arrow key rstudio interface: this goes back to the previous commands/lines you wrote and sent in the console.