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? if yes, How must I do that? what is the extension? I really appreciate your help -- View this message in context: http://www.nabble.com/I-don%27t-know-how-to-run-a-r-code-written-in-emacs-tp19348030p19348030.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
did you install ess for emacs? On Sat, Sep 6, 2008 at 11:52 AM, Luisa <lupasaviz at yahoo.com> 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? if yes, How must I do that? > what is the extension? > > I really appreciate your help > > -- > View this message in context: http://www.nabble.com/I-don%27t-know-how-to-run-a-r-code-written-in-emacs-tp19348030p19348030.html > Sent from the R help mailing list archive at Nabble.com. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- ==============================WenSui Liu Acquisition Risk, Chase Email : wensui.x.liu at chase.com Blog : statcompute.spaces.live.com
Marianne Promberger
2008-Sep-06 20:53 UTC
[R] I don't know how to run a r-code written in emacs
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
2008/9/6 Luisa <lupasaviz at yahoo.com>:> > 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? if yes, How must I do that? > what is the extension?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