[R] A hint to start ESS-xemacs

Jonathan Baron baron at psych.upenn.edu
Sun Dec 7 13:28:05 CET 2003


On 12/07/03 08:38, v.demart at libero.it wrote:
>I'm trying to use ESS & xemacs under debian linux testing and KDE.
>
>My problem is that I didn't find any document in the internet explaining a
>**step by step** session with R and xemacs.

Here is how I do it.  (I admit that it is much easier to tell you
this than to find out where I learned it.)

1. Start Xemacs.  (I do this about once a day and keep it in one
   viewport.  I don't know if KDE has viewports the way that
   Metacity does under Gnome.)

2. In Xemacs, give the command M-x R (which for me is alt-x R).
   This starts R as a function in Xemacs.  It prompts for a
   directory and I answer the prompt question with wherever the
   relevant .R file is.

3. In another viewport (or window, or whatever), open the .R file
   with gnuclient, e.g. "gnuclient myfile.R".  (I have a key
   aliaised to gnuclient in my .cshrc.)

The order of steps 2 and 3 can be reversed.  And I don't think
you need to use gnuclient, although it is faster than starting
Xemacs.

As for saving the session, I think you can do that when you exit
R in the Xemacs window, in the usual way.  But I don't.  Instead,
I save commands that I like (about 10% of the things I try, which
is why I don't save the session) by cutting and pasting them from
the first window to the second, and then I save the second.
Sometimes I put # in front of them (e.g., when they involve
making and saving a figure, which I don't want to remake every
time I run the file).  Sometimes I put readline() or stop()
commands in the file, so that I don't have to run the whole
thing.

When you are done, you can quit R in the first window with q(),
then use Xemacs for something else.  When I write a paper, I
usually have at least two gnuclient windows, one containing the
paper, one the .R file.

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page:            http://www.sas.upenn.edu/~baron
R page: http://finzi.psych.upenn.edu




More information about the R-help mailing list