Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
r [2021/12/14 18:32] root |
r [2022/12/07 16:17] (current) root |
=== R === | === R === |
| |
The "R" statistical/programming package is installed on the clusters. Most add-on packages are installed in the 4.0.2 version. Also included are slightly newer 4.1.0 and slightly modified Microsoft R Open 4.0.2, plus older saved versions. See [[https://www.analyttica.com/microsoft-r-or-open-source-r-which-suits-you-the-best/|R vs. Microsoft R]]. | The "R" statistical/programming package is installed on the clusters. The greatest number of add-on packages are installed in the 4.0.2 version. Also included are older saved versions, newer 4.1.0 and R 4.2.2 and slightly modified Microsoft R Open 4.0.2 [[https://web.archive.org/web/20200808203121/https://analyttica.com/microsoft-r-or-open-source-r-which-suits-you-the-best/]]. |
| |
<code> | <code> |
module load gcc/7.3.1 mkl/19.0.4 R/4.0.2 | module load gcc/9.3.1 mkl/19.0.5 R/4.2.2 |
| </code> |
| "gcc" module may be omitted unless you are adding R packages (see below). Substitute R/4.1.0 or MR/4.0.2 as desired for those versions. You can also add rstudio if you want the gui. This is best run through a portal (via interactive-apps Desktop or Rstudio GUI). |
| <code> |
| module load gcc/9.3.1 mkl/19.0.5 R/4.2.2 rstudio |
</code> | </code> |
"gcc" module may be omitted unless you are adding R packages (see below). Substitute R/4.1.0 or MR/4.0.2 as desired for those versions. | |
| |
If you need a new R package, you can ask support to add it to the central installation, or you can add your own packages as shown below for the package "broman". R is not as prone to conflicts as Python, so most packages can be added to the central installation without issues. Another way to create a custom installation is using [[python|conda]], which would be better if you see conflicts with standard ''R''. It will, however, install many thousands of files in your home. | If you need a new R package, you can ask hpc-support to add it to the central installation, or you can add your own packages as demonstrated below for the package "broman". R is not as prone to conflicts as Python, so most packages can be added to the central installation without issues. Another way to create a custom installation is using [[python|conda]], which would be better if you see conflicts with standard ''R''. It will, however, install many thousands of files in your home. |
| |
For this simple installation, before starting, create files ~/.Rprofile and ~/.Renviron as shown, plus other variables you may want to set. See [[https://rstats.wtf/r-startup.html|rstats.wtf]]. Some redundant text output has been omitted. | For this simple installation, before starting, create files ~/.Rprofile and ~/.Renviron as shown, plus the R library directories (changing full version 4.2.2 to 4.2 in this example) and any of the other R environment variables you may want to set [[https://rstats.wtf/r-startup.html|rstats.wtf]]. |
| |
<code> | <code> |
pinnacle-l4:feynman:$ cat .Renviron | pinnacle-l4:feynman:$ cat .Renviron |
R_LIBS_USER=~/R/%p/%v | R_LIBS_USER=~/R/%p/%v |
pinnacle-l4:feynman:$ module load gcc/7.3.1 mkl/19.0.4 R/4.0.2 | pinnacle-l4:feynman:$ cd;mkdir -p R |
| pinnacle-l4:feynman:$ mkdir -p R/x86_64-pc-linux-gnu |
| pinnacle-l4:feynman:$ mkdir -p R/x86_64-pc-linux-gnu/4.2 |
| </code> |
| |
| With those files in place you can install any R package yourself. Some redundant text output below has been omitted. |
| |
| <code> |
| pinnacle-l4:feynman:$ module load gcc/9.3.1 mkl/19.0.5 R/4.2.2 |
pinnacle-l4:feynman:$ R | pinnacle-l4:feynman:$ R |
| R version 4.2.2 (2022-10-31) -- "Innocent and Trusting" |
| Copyright (C) 2022 The R Foundation for Statistical Computing |
| Platform: x86_64-pc-linux-gnu (64-bit) |
| |
R version 4.0.2 (2020-06-22) -- "Taking Off Again" | |
[Previously saved workspace restored] | [Previously saved workspace restored] |
| |