This is an archived course. Information may be out of date, some links are broken and email addresses have been removed.

03 Lesson 1A


by A. Mani


See ''scistatRred.pdf'', below and .


For most ordinary purposes, there is no special need to compile R from source. Simply use the packages provided by your Linux/ BSD distribution. Install core packages and any number of ''R libraries''. Some libraries may not be available in your distribution.



Getting Help:


#help.start() - For html help



You can search cran and also subscribe to their various (high traffic) mailing lists.


> library (Rcmdr)

This is how you start Rcmdr (or load a package into R).
Rcmdr is useful for running and debugging code, but not exactly for writing it. You will however need to learn CLI methods as well.

Recommended Editors: Emacs, Kate, Vim or any of your favourite programming editors (with mark up for R)

R Scripts :

R scripts need to saved with .R extension.

Example : sym.R

> x <- 5+9*5

> x

You can do this on the CLI or put them on a file and ''source'' them.

Exercise-1: Do it.

Exercise-2: Write a R script including all arithmetic operations.

Exercise-3: Explain each LOC in the following:

>x <- c(1,3,7, 9, 2)


>y <- as.integer(x)


>z <- (as.vector(x))*(as.vector(x))