# REPL

> R comes with a full-featured interactive command-line REPL (read-eval-print loop) built into the`R` executable. In addition to allowing quick and easy evaluation of R statements, it has a searchable history, tab-completion, many helpful keybindings, and dedicated help `?` and shell modes `;`.

This page provides examples of using REPL on the command line.

## R REPL Example

* Type "module load r" in terminal to load the R module, then on a new line type "R" to launch R
* In terminal, q() quits the R module

<figure><img src="https://3954978562-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv4bMBkQ3ZBxkXjskIqBa%2Fuploads%2FH7l4wOvEgd6bman21pD5%2FScreenshot%202024-11-18%20at%203.46.44%E2%80%AFPM.png?alt=media&#x26;token=c871e2a4-ecde-43e3-9c97-177fcfa3f3c6" alt=""><figcaption></figcaption></figure>

## R REPL Help Pages

* Type "?" or help(function) to enter help pages within R's REPL
* For example, to ask for help with linear functions in R, use help(lm) (output shown below)

<figure><img src="https://3954978562-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv4bMBkQ3ZBxkXjskIqBa%2Fuploads%2Fe4P6oHleLyE5DcPvVDN8%2FScreenshot%202024-11-18%20at%203.52.00%E2%80%AFPM.png?alt=media&#x26;token=b1dc1135-df8a-418a-9118-7446b030dbf7" alt=""><figcaption></figcaption></figure>

## Resources

* [REPL Environment Help](https://www.r-project.org/help.html)
