![]() |
Introduction
To R |
If you have never used emacs before, read a
short emacs tutorial. If you have but need some quick reference to
emacs, take a look at emacs
reference card.
$ emacs ~/.emacsand enter the following:
(global-font-lock-mode t) (load "/home/shimakur/Emacs/ess/lisp/ess-site")Now quit Emacs (C-x C-c) and start it again. We're all set.
Now execute R-mode - enter M-x R Think of M-x as `execute' and `R' for R. Emacs will then ask you for your R Starting Directory - enter the directory where you want to create a new (or open an already existing one) .RData.
This will then produce a new buffer called *R*, which runs
R and gives a standard R prompt > - you can now type R expressions
at this prompt and they will be run as if you were running from a command
window.
You'll also get a full log of your session in the buffer. This can be useful when you forget how you did something half an hour ago. The buffer is just like any other Emacs buffer, and can be scrolled around and searched.
To get back to the R prompt from anywhere in Emacs, just do M-> (this is the Emacs code for `end of file').
Other advantages of running in Emacs will become apparent shortly. Now its time to start doing things in R...