Quick links: install R | R code used in class
| Getting started, part 1
Installing R for Windows
R consists of a "base" distribution and add-on packages that may
be downloaded and installed separately. To install the base distribution,
download the Setup program
(about 20 megabytes) and run it. The
setup will ask you to agree to the licence and ask for a location on
your computer to install R.
q()
to quit R. You can also quit with the Exit option of the File menu.
> install.packages("packagename")
from the R prompt (the >)
to fetch the package named packagename from the
"master" R website, or
> options(CRAN="http://stat-db.stat.sfu.ca/CRAN")
> install.packages("packagename")
to fetch packagename from a local R "mirror" site.
To use a package you have installed, use the Packages-->Load package menu item to load the package for use. Alternatively, from the R-prompt type
> library(packagename)Packages you may find useful are
genetics:
A package that includes functions for handling genetic
data, including tests of Hardy-Weinberg equilibrium. This package
requires two others, combinat and gregmisc.
You could download and install all three with
> install.packages(c("combinat","gregmisc","genetics"))
gam: A package for fitting generalized additive
models.
mgcv: Also fits generalized additive
models, using cross-validation to select smoothing parameters.
(*Don't* use gam and mgcv at the same time.)
boot: A library of functions for obtaining
bootstrap estimates of variance-covariance matrices.
Rcmdr: An add-on package that
provides a user-friendly front-end for R.
There are also many websites written by R users. For example Rtips has a list of tips the author found useful while getting started with R. We have also prepared a Getting Started page with examples drawn from the first homework. You should also feel free to post messages to the class caucus for R help.