R

Installing an R Package

 

The RCE provides almost all stable libraries maintained in the Comprehensive R Archive Network (CRAN), and others. For a full list refer to "Which R packages are available?"

If you would like to install a library separately for your own personal use, follow these instructions:

  1. In R, type library(<package_name>).

    For example, to install R Commander, type the following:

    > library(Rcmdr)

    R prompts you with a warning if the package that you chose to install uses other packages that are not installed already.

  2. To install missing packages on which your target package depends:

    1. Click Yes to continue. The Install Missing Packages window is displayed.

    2. Click OK to continue. R prompts you to select a mirror site from which to download the packages' sources.

  3. Select a site from which to download the sources, and then click OK.

    The dependent packages and your target package are now installed. If it is an executable, the function is executed.

Alternatively, you can install packages from within R like this:

install.packages("package_name")

If the R package fails to compile, you may need a newer version of GCC. See this page for using updated versions of developer tools.