[R] programming in R

Kort, Eric Eric.Kort at vai.org
Mon Aug 12 20:38:56 CEST 2002


> -----Original Message-----
> From: Alexandra Patriksson
> [mailto:Alexandra.Patriksson.8520 at student.uu.se]
> Sent: Monday, August 12, 2002 11:56 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] programming in R
> 
> 
> I have a probably basic problem concerning the R language.
> I will write some small R programs but don't really know how 
> to start. Do I have
> to create my files in some editor like emacs or can I write 
> my code in the R
> prompt? How to compile the code?
> 
> I haven't found any good manual parts about this subject.
> 
> regards
> A.P

You can write your code at the R prompt to test things out, but when you are ready to write up procedures or functions that you will want to repeat or otherwise document for future reference, you will want to write it up with an editor such as emacs.  I usually create a folder for each of my projects, and keep my data files and saved code in that folder (for example, I might have a folder called "c:/research/microarray" and a file called "c:/research/microarray/microarray.r" to hold the relevant code for that project.) 

R is an "interpretted" language, not a compiled language, so you don't need to compile it.  Just type your code into a file (e.g. "yourfile"), and then type:

source("yourfile")

at the R prompt.  (Also, R has a batch mode...but that is another topic).

Have you gone through the introductory session described starting on page 10 of the "Introduction to R" manual?  (http://cran.r-project.org/doc/manuals/R-intro.pdf)

hth,
Eric
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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