# R Console (Page)

The R console is displayed as page in the Console View of the Eclipse IDE.

The R console page is separated in two areas: the input line and the output viewer. The input line allows you to submit directly input to the launched tool. The output viewer shows all submitted input and their “response”, the output of R.

## Cmd Input

You can type commands in input line text field and edit code almost like in a usual editor of StatET. Pressing `ENTER` or the 'Submit'-Button sends your current input to your tool.

#### Special shortcuts

There are some special actions and keyboard shortcuts to access the command history and to scroll the output viewer, if you are in the input line:

Description | Availability
--- | ---
History control
Go to the following older history item | `Up`
Go to the following newer history item | `Down`
Go to the newest history item (last input) | Local command `Ctrl+Alt+End`
Search for the following older history item starting with the text before the cursor. | Local command `Ctrl+Alt+Up`
Search for the following newer history item starting with the text before the cursor. | Local command `Ctrl+Alt+Down`
Tip: You can use the Undo feature to go back to the last edited input.
Output control
Scroll output one line up | `Shift+Up`
Scroll output one line down | `Shift+Down`
Scroll output one page up | `Shift+PageUp`
Scroll output one page down. | `Shift+PageDown`
Scroll output to the start | `Shift+Ctrl+Home<enablement><not></not></enablement>` `Shift+Command+Home<enablement></enablement>`
Scroll output to the end | `Shift+Ctrl+End<enablement><not></not></enablement>` `Shift+Command+End<enablement></enablement>`

The commands to include for the history navigation can be configured in the preferences; by default only commands directly from the console are enabled.

#### Content Assistant

See Content Assistant of R editor.

For remote consoles, the completion of resource paths requires the configuration of resource mappings.

## Console Output

- Coloring of errors
- Links to line in script when submitting from script

## Actions of the R Console

As any other view, the Console view offers a toolbar with buttons and menus that allow straightforward interaction and configuration, as well as the view menu in the right corner of that toolbar.

See also: Console View.

| Name | Description | Availability
--- | --- | --- | ---

Cancel Task

Cancel Tasks is a menu that allows to cancel the execution of the currently running R task. This can be useful e.g. when one launches an intensive simulation, but discovers the parameters were not correctly specified. The menu offers three options.

The first one is also used when pressing the button directly and assigned to the default keyboard shortcuts.

View toolbar
Global command
`Ctrl+Break`
`Break`

| Terminate | The Stop Console button allows to quit a given R. On pressing this button, the user will be prompted to save the workspace or not (can be disabled by launch arguments). | View toolbar

Paste /
Paste/Submit /
Drop

The paste command for the input field works as usual; it inserts the text from the clipboard at the selected position. The text can be edited before submitting the code to R.

If the output area is active (e.g. using its context menu), the paste command submits the text from the clipboard to R directly. The current text in the input field is not changed.

When dragging text using the mouse, dropping the text into the R console acts like the paste command to the input / output area described above.

Main menu (Edit)
Context menu
Local command
`CTRL+V`
Drag & Drop

Output
| Clear Console / Clear Console Output | The Clear command will clean the output window of the console. After clearing the console, it obviously is no longer possible to scroll up to previous output. | View toolbar Context menu (Output) Global command `Ctrl+L` `Ctrl+R L`

Scroll-Lock

The Scroll-Lock button is a toggle button that allows to lock scrolling of the console output window. This implies that when submitting new statements either at the command line or from a script, the view the user has on the output window will not change. It is, of course, always possible to manually scroll to a given location within the output window.

View toolbar
Context menu (Output)

| Adjust Output Width / Adjust Console Output Width | This menu item will change the number of characters of an R output line, such that it perfectly fits the current dimensions of the R Console View. The function adapts the R option `width` (see R help of 'options'). | Context menu (Output) Global command

#### Change Working Directory

This menu item allows to change the R working directory of the console via an Eclipse interface.