# 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="/files/wvXas2Ygi3A8XTS4BgZF" alt="Terminal screen with R launched. > &#x22;Hello, World!&#x22; Output = &#x22;Hello, World!&#x22;; > word = &#x22;test&#x22; > typeof(word) Output = &#x22;character&#x22;; >nchar(word) Output = 4; >print(word) Output = &#x22;test&#x22;; > q()"><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="/files/ycKSgxUJxVWYr1KyzN3u" alt="Terminal screen with R launched. Output of command help(lm)"><figcaption></figcaption></figure>

## Resources

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bcbi.brown.edu/codiac-for-health/computing/r/repl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
