← Back to R Course | Chapter 1: Getting Started | Lesson 2 of 6

The R Console

In this page:

  1. The R Console

The R Console

The R console is an interactive prompt where you type expressions and see results immediately, useful for quick exploration before writing a full script. Every complete expression you enter is evaluated and its value printed automatically at the console (though not inside a script). Scripts, by contrast, need explicit print() or cat() calls to show output.

Note: At the interactive console, just typing a variable's name prints its value -- but inside a script you must call print() explicitly.

Example: The R Console

markup
x <- 42
print(x)

y <- x * 2
print(y)
🔒

Chapter Quiz — Complete all 6 topics to unlock

0/6 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.