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

Marianne Promberger mpromber at psych.upenn.edu
Sat Sep 6 22:53:46 CEST 2008


On Saturday, 06 September 2008, 08:52 (UTC-0700), Luisa wrote:
> 
> Hi,
> I just installed R, I'm  work in UBUNTU and  I don't have idea about how to
> run a r-code written in emacs
> into the shell. 
> Well I am in a shell, and obviously I can run simple commands over there,
> Must I  compile the program? 

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")

> what is the extension?

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.



-- 
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber



More information about the R-help mailing list