[R] ESS with Xemacs? [vs. Emacs, slightly off topic]

Warnes, Gregory R gregory_r_warnes at groton.pfizer.com
Tue Jan 8 14:13:09 CET 2002


 >  From: Agustin Lobo [mailto:alobo at ija.csic.es]
 >  Sent: Tuesday, January 08, 2002 7:47 AM
 >  
 >  Happy 2002 to everyone.
 >  
 >  I'm following Greg's directions (with some pain, as I'm not
 >  an experienced (x)emacs user) and I find that I cannot use 
 >  fix() in the R session. 
 >  Before trying (x)emacs I normally had
 >  a "raw" R session in an xterm and an editor in another window.
 >  When I was done writing the function I run fix() and copied 
 >  and pasted
 >  the function to the editor session that had been opened by fix().
 >   
 >  I understand that, using (x)emacs I can save the function to a
 >  text file and source() it in R, but this seems like an odd
 >  procedure considering that both R and the function are in 
 >  windows of the same (x)emacs environment. Is there any simpler
 >  way of passing the edited function to R?

Hi Agustin,

Are you using the emacs/xemacs package 'ESS'?  [Highly recommended.] If you
are, you can use '<Control>-<C> <Control>-<D> function-name' to bring a
function in an (x)emacs buffer.  

To get edit/fix to work properly under (x)emacs, you need to tell R that you
want it to call 'gnuclient' for editing.  Do this by either setting the
environment variable 'EDITOR' before starting R or by setting
options(editor=...) with R.  Note that setting the EDITOR environment
variable will effect lots of programs...

In my shell startup script I set my environment variable EDITOR to point to
a small script file called 'MyEdit' that contains

	#!/bin/sh
	gnuclient $* || vi $*

this first tries to open the file using 'gnuclient'.  If this fails, which
it will if (x)emacs is not running, it then tries to open the file using
'vi'.  This works well for me.

 >  By the way, is there an R-oriented guide or tutorial
 >  to (x)emacs?

In the ESS source directory, the doc/README.S contains a brief tutorial on
using Splus/R with (x)emacs.  Its not a real tutorial, but it should still
be quite helpful.

For a more general tutorial (x)emacs, try '<Control>-h t'

It takes a while to get used to (x)emacs, but it really is a good
environment for interacting with R/Splus once you've mastered it.

-Greg


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list