Skip to content

I don't know how to run a r-code written in emacs

4 messages · Luisa, Wensui Liu, Marianne Promberger +1 more

#
did you install ess for emacs?
On Sat, Sep 6, 2008 at 11:52 AM, Luisa <lupasaviz at yahoo.com> wrote:

  
    
#
On Saturday, 06 September 2008, 08:52 (UTC-0700), Luisa wrote:
Which program? Emacs? If you've installed R, you can read a txt file
of R code into your R session with 

source("/path/if/any/file.R")
not sure what you mean. It makes sense to save files with R commands
with the ".R" extension, but AFAIK it's not obligatory.

If you don't have ess, I think you can get that, too, with "aptitude
install ess".

Then, in Emacs, you can open R with M-x R. You can now copy&paste
(kill&yank) R code from your text file to the R buffer; alternatively
there are special commands available, look at the menu in Emacs. If
you have Emacs anyway, ESS is much more convenient than running from
the console.

m.
#
2008/9/6 Luisa <lupasaviz at yahoo.com>:
You don't need to compile anything and you can use .R as an extension
for your R scripts (I believe someone else has suggested this already
though). What I usually do to run my scripts, is something like the
following:

R < foo.R,

where foo.R is the name of the script. The man page for R suggests
this usage (admittedly, though, it's perhaps not obvious) and there
are options listed in it that you may want to use.

For what it's worth, it makes no difference which editor you use to
write your code in.

Regards,

Nicky Chorley