R and RStudio

If you have a pre-existing installation of R and/or RStudio, we highly recommend that you reinstall both and upgrade to the most recent version. It is very easy and RStudio, specifically, is changing rapidly and positively (written 2014-11). You may even wish to use the preview version of RStudio (we do!) available here.

    update.packages(ask = FALSE, checkBuilt = TRUE)

Note: this will only look for updates on CRAN. So if you use a package that lives only on GitHub or if you want a develoment version from GitHub, you will need to update manually, e.g. via devtools::install_github().

Testing testing

Add-on packages

R is an extensible system and many people share useful code they have developed as a package via CRAN and GitHub. To install a package from CRAN, for example the plyr package for data aggregation, here is one way to do it in the R console (there are others).

install.packages("plyr", dependencies = TRUE)

By including dependencies = TRUE, we are being explicit and extra-careful to install any additional packages the target package, plyr in the example above, needs to have around.

You could use the above method to install the following packages, all of which we will use:

Further resources

The above will get your basic setup ready but here are some links if you are interested in reading a bit further.