Difference between revisions of "R/Extension"
(Created page with "Since R is highly extensible, users can work with several additional packages supplemented by R developers. The list of already installed packages can be displayed with the fo...")
Revision as of 06:04, 4 August 2016
Since R is highly extensible, users can work with several additional packages supplemented by R developers. The list of already installed packages can be displayed with the following R command in an interactive session:
This should give you an overview on a common set of R packages. If you require an R package, which is not yet installed, you can either install it locally in your home directory, or you can contact us, such that we can install the package centrally if it is used by many cluster users.
For installing an R package locally, you first have to load the R module corresponding to the version for which it should be installed. After this you can launch R.
module load new gcc/4.8.2 r/3.3.0 R
Packages can be installed by the packages.install() command (we use here the package "actuar" as an example)
This command will cause a warning, since users do not have write access to the library directory of the corresponding R installation:
Warning in install.packages("actuar") : 'lib = "/cluster/apps/r/3.3.0_openblas/lib64/R/library"' is not writable Would you like to use a personal library instead? (y/n)
When asked if you would like to use a personal library, confirm this by typing y. This will create a local library directory $HOME/R/x86_64-unknown-linux-gnu-library/3.3 where the package will be installed at a later stage. Next you will be asked if you like to install the package in your local library directory
Would you like to create a personal library ~/R/x86_64-unknown-linux-gnu-library/3.3 to install packages into? (y/n)
After confirming this you will have to choose a download mirror. Versions 3.2 and newer have problems with HTTPS mirrors, therefore you should choose option "18", which uses a HTTP mirror for downloading the package sources. After choosing the download mirror, the package will be downloaded and installed. The locally installed R package is now ready to be used.