Using TIBCO Enterprise Runtime for R with ESS in Emacs

Using TIBCO Enterprise Runtime for R with ESS in Emacs

book

Article ID: KB0081594

calendar_today

Updated On:

Products Versions
Spotfire Enterprise Runtime for R All supported versions

Description

How can I set up ESS in Emacs with my TIBCO Enterprise Runtime for R installation?

Issue/Introduction

How can I set up ESS in Emacs with my TIBCO Enterprise Runtime for R installation?

Environment

TIBCO Enterprise Runtime for R on Microsoft Windows

Resolution

The attached file defines TERR (TIBCO Enterprise Runtime for R) customizations for ESS (available from http://ess.r-project.org/), allowing access to a TERR engine through Emacs.   This file has been tested with TERR 2.0 and ESS-13.09 on Windows with GNU Emacs 24.3.1, and on Linux with GNU Emacs 23.3.1. Please see the attached file for installation instructions, differences between using TERR and R in ESS, and a list of known issues.

If you are using Windows, step by step instructions are also included below for your convenience.

To Configure ESS in Emacs for TIBCO Enterprise Runtime for R:

1.    Locate your installation of TIBCO Enterprise Runtime for R.  In Spotfire, this path will be (SPOTFIRE_HOME/modules/TIBCO Enterprise Runtime for R_&ltversion>/engine/bin/TERR.exe)

2.    If you do not already have it installed, download and install ESS in Emacs for Microsoft Windows.

3.    Start Emacs for Microsoft Windows.

4.    To create an .emacs configuration file in ESS, press Ctrl-x, and then Ctrl-f and type in ~/.emacs.  (Alternatively, you can create this file using your favorite text editor.)

5.a.     If you can modify your Emacs installation:

1.    Paste the following into the .emacs configuration file:
    ;; load ess however you normally do
    (require 'ess-site)
    ;; specify TERR executable location (TERR.exe on Windows, TERR on Linux)
    (setq inferior-TERR-program-name "C:/TERR/image.20131023/bin/TERR.exe")
    ;; create autoload defns
    (autoload 'TERR "ess-terr-d" "Call 'TERR'." t)
    (autoload 'TERR-mode "ess-terr-d" "Major mode for editing TERR source." t)
    (autoload 'terr-mode "ess-terr-d" "Major mode for editing TERR source." t)

    2.    If ESS is unpacked in the directory EMACS_HOME/site-lisp/ess-13.09/, store the attached ess-terr-d.el file in EMACS_HOME/site-lisp/ess-13.09/lisp/ess-terr-d.el. (This specifies using the TIBCO Enterprise Runtime for R engine instead of the R engine.)

5.b.     If you cannot modify your Emacs installation:
    1.     Paste the following into the .emacs configuration file:
        ;; load ess however you normally do
        (require 'ess-site)
        ;; specify TERR executable location (TERR.exe on Windows, TERR on Linux)
        (setq inferior-TERR-program-name "C:/TERR/image.20131023/bin/TERR.exe")
        ;; load ess-terr-d file explicitly
        (load "~/ess-terr-d")

    2.     Save the attached ess-terr-d.el file into the same directory as your .emacs file.  Or if you choose to save it in another location, change the line (load "~/ess-terr-d") to give the full path to the ess-terr-d.el file.  

To Run Emacs using TIBCO Enterprise Runtime for R console:

1.    Start Emacs.

2.    Press Esc-x, and then type TERR and press Enter.  This sequence of commands starts the console, specifying using TIBCO Enterprise Runtime for R.

3.    Press Enter again when prompted (at the bottom of the Emacs window) for a starting data directory, or specify a different directory.  The TIBCO Enterprise Runtime for R console should have started.
 

Additional Information

Emacs Speaks Statistics (ESS) is an add-on package for emacs text editors such as GNU Emacs and XEmacs. It is designed to support editing of scripts and interaction with various statistical analysis programs such as R, S-Plus, SAS, Stata and JAGS. Although all users of these statistical analysis programs are welcome to apply ESS, advanced users or professionals who regularly work with text-based statistical analysis scripts, with various statistical languages/programs, or with different operating systems might benefit from it the most.

To obtain more information ESS (including download links), please see their website at:

http://ess.r-project.org/