Home
Up to Help
Docs
R Help
Packages
CRAN
R.oo
aroma
Install
The R software
Most packages
Tips'n'Tricks
install.packages
Rgui (Windows)
External Links
R homepage
Download R
bioconductor.org
braju.com packages
Printerfriendly
Print this page

R Help
R is a free software very similar to SPLUS and it can be downloaded from http://www.rproject.org where you also find the wonderful quickly responding mailingslist rhelp.
At the Centre for Mathematical Sciences, R is available on all Sun Solaris and Suse Linux machines by typing
% R
at the prompt. Old (and new versions) of R can explicitly be accessed by Rnnn where nnn is the version number without dots, e.g. R181 for R v1.8.1 and so on.
R Coding and Documentation Conventions
Objectoriented programming in R
Programming with references
Local packages & bundles
 Henrik Bengtsson, The R.classes bundle (R.oo and friends), 20012004. Installation instructions included (takes 30 seconds)
 Henrik Bengtsson, aroma  An R Objectoriented Microarray Analysis environment written in 100% R, 20012004. With installation instructions too (takes 30 seconds). This package was formerly known as com.braju.sma (see below).
 Henrik Bengtsson, The com.braju.sma package  A microarray analysis packages based on an objectoriented design and reference variables, extended abstract, Mathematical Statistics, Lund University, November 2002.
(pdf, ps)
 Henrik Bengtsson, R.matlab  Local and remote Matlab connectivity in R, 20022004. Communicate with Matlab from within R.
Introduction to R
 Emmanuel Paradis, R for Beginners, Université Montpellier II, France, Aug 2002. (pdf)
 Jonathan Baron, Notes on the use of R for psychology experiments and questionnaires, University of Pennsylvania, Aug 2001. (HTML, pdf)
 KoKang Wang, R for Windows Users, Department of Statistics, New Zealand, October 2002. (HTML, pdf, ps, tex)
 Ross Ihaka, Statistics 120  Information Visualisation (HTML)  A great set of lecture notes and R packages for graphical presentation of data etc. Look at it!
Quick references to R
 Jonathan Baron, R reference card, University of Pennsylvania, Aug 2001. ( pdf)
 Robin Hankin, R For Octave [& Matlab] Users, 2001. (txt)
How to's and Code examples
R on Windows
 H. Bengtsson, Windows bat file to get a Command prompt ready for R. See instructions in header comments. RCMDprompt.bat.
Other R help pages
 R Help Center at the Institute de Statistique, Universite catholique de Louvain, Belgium
Miscellaneous
How do I print from R?
After you have created a plot you have to save it to file and from there print it. Example
plot(sin(1:10))
dev.print(postscript, file="/tmp/out.ps")
system("lpr Pps3 /tmp/out.ps") # Call lpr from within R
How to autosave the command history
To save the commandline history automatically when exiting R just add the following in your ~/.Rprofile file:
.Last < function() {
savehistory();
}
Sweave
Sweave is a really great tool, which allows you to incorporate executable R code within for instance LaTeX documents. First Sweave() is called on your RLaTeX hybrid document, the R code is extracted and evaluated. Figures that are generated are saved as EPS and PDF files, necessary LaTeX code to incorporate the figures in the LaTeX document is inserted in place. The final result is a LaTeX document (together with figure files), which can be compiled as usual. How does it work? See help(Sweave) in the tools package.
One common problem is that people encounter is that the Sweave.sty file is missing. It is located at ${RHOME}/share/texmf/Sweave.sty ; just save it in the same directory as your LaTeX document.
