Archive

Posts Tagged ‘statistics’

Installing ESS (Emacs Speaks Statistics)

20 April 2011 Leave a comment

Problem

You have a non-standard directory under which you install software. You have installed Emacs under this directory. Now you want to install ESS under this directory as well so that Emacs could interact with R.

Solution

Suppose your non-standard directory is

/scratch/username/usr

where username is your actual username. I assume that you have installed both Emacs and R under this directory. Download ESS and extract the downloaded tarball to

/scratch/username/usr/share/emacs/site-lisp

Edit your /home/username/.emacs by inserting the following lines:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;     
;; ESS: Emacs Speaks Statistics, mainly for R
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;     

(load "/scratch/username/usr/share/emacs/site-lisp/ess-x.y.z/lisp/ess-site")
(setq inferior-R-program-name "/scratch/username/usr/bin/R")

Remember to replace “x.y.z” with the actual version number of ESS that you use. Now load Emacs and to use R from Emacs, enter the command

M-x R

This should bring up an R session from within Emacs. Here’s a screenshot for your viewing pleasure: