Skip to main content

6.3) Using Contributed Packages


There were 5577 add-on packages at the last count, written by R-users and provided for the benefit of the R community. Using these gives you full access to R’s capabilities at the cutting edge of methods and research in data analysis. These packages must be installed and loaded before you can use them. There are two separate steps: downloading and installing, then loading. If you have normal access rights, like on your own PC, you can do it all from the Packages menu in the R console.

  1. First go to "Packages > Install package(s)…", which will first prompt you to select a CRAN mirror (choose one of the UK ones), and then give you the full list of packages to choose from. When you finish the selection procedure, it should install the required files – probably in a subdirectory called "lib" within your R program directory.
  2. Now you just have to load the package in any session where you want to use it. Type, for example, library(lme4) (or use the Packages menu) to load package "lme4", for multilevel (mixed) modelling.