blob: ce66839376056e9e66602caae11bb33666c6e426 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"/>
<title>R Console - Launching</title>
<meta name="copyright" content="Copyright (c) 2008, 2019 Stephan Wahlbrink and others. SPDX-License-Identifier: EPL-2.0 OR Apache-2.0"/>
</head>
<body>
<h1>Launching</h1>
<h2 id="configure">Configure Console</h2>
<p>Before being able to use an R Console, it is necessary to configure one.
The inconvenience of needing to specify configurations is very low compared
to the many advantages R configurations offer: one can configure R Consoles
for different versions of R (e.g. current release and devel release) or with
different default startup-options.</p>
<p>To configure a console, navigate to
<span class="uisequence indent">Run &gt; Run Configurations...</span>
</p>
<img alt="Screenshot R console config 'Main'" src="../images/screenshot_r_console_run_config_main.png"/>
<p>The user is invited to assign a name to the particular configuration and
adjust the relevant settings in the tabs of the configuration window.
The most important tabs are dealt with in detail in separate paragraphs
below.</p>
<h3>Main</h3>
<p>The <span class="uilabel">Launch Type</span> allows specifies how the connection to R will be
managed. The default is the Java-based RJ console connection which is fully cross-platform
(requires R package <code>rj</code>, see <a href="https://www.eclipse.org/statet">homepage</a>).
An older connection type Rterm is provided as well. Many features of StatET are only available
for RJ.</p>
<h5>R Options</h5>
<p>The <span class="uilabel">Working Directory</span> specifies the initial <b>working directory</b>
of your R session.</p>
<p>The <span class="uilabel">Options</span> field allows to specify R <b>startup-options</b>, such
as <code>--no-environ</code>,<code> --no-init-file</code> etc.</p>
<h3>R Config</h3>
<p>The R Config tab allows to specify which <b>R environment</b> to use.</p>
<img alt="Screenshot R console run config 'R Config'" src="../images/screenshot_r_console_run_config_R_config.png"/>
<p>An <a href="r_env.xhtml">R environment</a> is simply a given version of R linked to a certain path
on your file system. One can either choose the default R environment that you
set for the workbench or a specific environment (Selected Configuration). When
one presses the 'Configure...' button, the R Environments preference page will show up.</p>
<p>If the R environment is not yet setup, the following steps create a new configuration:</p>
<ol>
<li>'Add...' opens the edit dialog for a new local R environment configuration.</li>
<li>The user will be asked to provide a name and to indicate the
path to the <code>$R_HOME</code> for that given R (not <code>$R_HOME/bin</code> !!).</li>
<li>It is recommended to press <span class="uisequence">Detect Default Properties/Settings</span>
to load the defaults for the other properties and settings.</li>
<li>Upon clicking 'OK' the configuration will be added to the list of R
environments, so the user can make use of them when configuring the 'R Config'
tab of an R Console launch configuration.</li>
</ol>
<h3>Other Configuration Options</h3>
<p>The console option 'Pin initial console automatically' will pin the initial
console. This means that when one opens additional R consoles, these
will be opened in separate Console Views.</p>
<h2 id="launch">Launch Console</h2>
<p>To launch a run configuration such as an R console, one can accede the Run
menu and choose
<span class="uisequence indent">Run &gt; Run Configurations...</span>
Among the many possible run configurations, you will find the R Console menu
with a list of all currently R Console configurations.</p>
<p>You can either double-click on the R Console configuration of your choice or
select the configuration and click on the Run button.</p>
<!-- TODO add screenshot -->
<p>If during configuration of an R Console, you chose to display this
particular run configuration in the favorites menu, the configuration
will be listed.</p>
<img style="width: 388px; height: 93px;" alt="Screenshot run configuration menu" src="../images/screenshot_run-configuration-2.png"/>
<h4 id="debug">Launching in <em>Debug</em> mode
(<img src="../icons/tool/debug.png" alt="Debug Icon" title="Icon"/>)</h4>
<p>If you want to debug R code using the <a href="r_debug.xhtml">integrated visual debugger</a>,
the console have to be started in the <em>Debug</em> mode. Instead of the 'Run' toolbar or
menu items, choose the respective 'Debug' items. To open the launch configuration, select:
<span class="uisequence indent">Run &gt; Debug Configurations...</span>
The configurations are shared with the configuration for the Run mode.</p>
<p>You can either double-click on the R Console configuration of your choice or
select the configuration and click on the Debug button to launch the console
with enabled support for the debugger.</p>
</body>
</html>