Changes
Page history
added extra R info about package management
authored
Apr 07, 2021
by
van Vliet
Hide whitespace changes
Inline
Side-by-side
home.md
View page @
a4229788
...
...
@@ -1662,6 +1662,73 @@ You can load R with one of the modules:
*
statistical/R/3.6.2/gcc.8.3.1
*
statistical/R/4.0.2/gcc.8.3.1
#### R package management
Local R packages are installed in:
*
$HOME/R/x86_64-pc-linux-gnu-library/version
Global R packages are installed in:
*
/share/software/statistical/R/R-version/lib64/R/library/
Getting list of installed R packages and information:
*
installed.packages()
*
packageDescription("package")
*
help(package = "package")
*
packageVersion("package")
example:
*
packageDescription("stats")
*
help(package = "stats")
*
packageVersion("stats")
##### Installing R packages
You can find a list of R packages here:
*
https://cran.r-project.org
*
https://cran.r-project.org/web/packages/available_packages_by_name.html
Get a list of mirrors:
*
getCRANmirrors()
Choose a mirroe:
*
chooseCRANmirror()
For example, choose: 53: Netherlands [https]
Install a R package:
*
install.packages("package")
Install a R package with all the dependencies:
*
install.packages("dplyr", dependencies = TRUE)
Install a R package with a mirror url link:
*
install.packages("vioplot", repo = "https://lib.ugent.be/CRAN/")
Install 2 or more R packages:
install.packages(c("vioplot", "MASS"))
##### Removing R packages
Remove R packages with:
*
remove.packages("package")
*
remove.packages("vioplot")
You can only remove R packages which are installed in your own home folder.
You can not remove globally installed R packages.
##### Updating R packages
You can check what packages need an update with a call to the function:
*
old.packages()
Updating packages (local):
*
update.packages()
If a global R package needs to be updated, contact the Linux team.
#### Running R interactively
You can start to run R interactively, just as an exercise and test.
...
...
...
...