Wartung!
Confluence wird am Montag, den 23.09.2024, zwischen 11:30 Uhr und 12:30 Uhr kurzzeitig nicht zur Verfügung stehen. Der Grund dafür sind Wartungsarbeiten an der IT-Infrastruktur des ZIM.
Wartung!
Confluence wird am Montag, den 23.09.2024, zwischen 11:30 Uhr und 12:30 Uhr kurzzeitig nicht zur Verfügung stehen. Der Grund dafür sind Wartungsarbeiten an der IT-Infrastruktur des ZIM.
Eine weit verbreitete Programmierumgebung für statistische Berechnungen und Grafiken.
Inhalt type flat
Aktuell haben wir auf dem Cluster Version 4.3.6.1 als 3 als neueste Version von R installiert. Aus Gründen der Kompatibilität werden jedoch auch ältere Versionen (siehe rechte Spalte) angeboten.
Alle Versionen wurden mit dem Intel Compiler aus dem Intel® Parallel Studio XE übersetzt und sind gegen die Intel MKL gelinkt.
Die Version 4.3.3 wurde mit dem GNU C-Compiler 13.2.0 übersetzt. Diese Version ist mit dem Befehl
Codeblock |
---|
module load R/4.3.3-gcc |
zu laden. In der Version R/4.3.3-gcc stehen auch die meisten vom System her schon bereitgestellten Pakete/Bibliotheken (libraries) zur Verfügung. Diese können mit dem library() Befehl geladen werden.
Info | ||||
---|---|---|---|---|
| ||||
Currently we have a mirror for CRAN to allow you to install packages without direct internet access. Please use http://cran.repo.test.hhu.de/ as mirror on Hilbert. We have also installed a mirror for Bioconductor, use
in R to access the local mirror (working with R Versions 4.0.3, 4.2.2, 4.3.2 and 4.3.3). To make it easier you can create the file .Rprofile in your home directory with contents:
This way you do not need to specify the mirrors every time you want to install new packages. |
Eine Liste aller Zusatzpakete innerhalb von R erhält man mit:
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
ip <- as.data.frame(installed.packages()[,c(1,3:4)]) rownames(ip) <- NULL ip <- ip[is.na(ip$Priority),1:2,drop=FALSE] print(ip, row.names=FALSE) |
In der aktuellen Version sind folgende Zusatzpakete vorhanden (Stand 14.05.2019):
Paket | Version |
---|---|
assertthat | 0.2.1 |
BH | 1.69.0-1 |
bigmemory | 4.5.33 |
bigmemory.sri | 0.1.3 |
bit | 1.1-14 |
cli | 1.1.0 |
coda | 0.19-2 |
colorspace | 1.4-1 |
crayon | 1.3.4 |
deSolve | 1.21 |
doParallel | 1.0.14 |
foreach | 1.4.4 |
glue | 1.3.1 |
iterators | 1.0.10 |
lazyeval | 0.2.2 |
magrittr | 15 |
plyr | 1.8.4 |
Rcpp | 1.0.1 |
reshape | 0.8.8 |
reshape2 | 1.4.3 |
stringi | 1.4.3 |
stringr | 1.4.0 |
SuppDists | 1.1-9.4 |
whisker | 0.3-2 |
Pakete, die in der Version R/4.3.3-gcc, die mit dem Gnu-Compiler übersetzt wurden, zur Verfügung stehen, sind die folgenden (Stand 04.04.2024):
Package | Version |
---|---|
abind | 1.4-5 |
alphavantager | 0.1.3 |
anytime | 0.3.9 |
ape | 5.7-1 |
aplot | 0.2.2 |
askpass | 1.2.0 |
assertthat | 0.2.1 |
backports | 1.4.1 |
base64enc | 0.1-3 |
BH | 1.81.0-1 |
bigmemory | 4.6.1 |
bigmemory.sri | 0.1.6 |
binom | 1.1-1.1 |
bit | 4.0.5 |
bit64 | 4.0.5 |
blob | 1.2.4 |
brew | 1.0-10 |
brio | 1.1.4 |
broom | 1.0.5 |
bslib | 0.6.1 |
cachem | 1.0.8 |
callr | 3.7.3 |
car | 3.1-2 |
carData | 3.0-5 |
cellranger | 1.1.0 |
cli | 3.6.2 |
clipr | 0.8.0 |
clock | 0.7.0 |
coda | 0.19-4 |
colorspace | 2.1-0 |
commonmark | 1.9.0 |
conflicted | 1.2.0 |
cpp11 | 0.4.7 |
crayon | 1.5.2 |
credentials | 2.0.1 |
crosstalk | 1.2.1 |
curl | 5.2.0 |
data.table | 1.14.10 |
DBI | 1.2.0 |
dbplyr | 2.4.0 |
desc | 1.4.3 |
deSolve | 1.40 |
devtools | 2.4.5 |
diagram | 1.6.5 |
diffobj | 0.3.5 |
digest | 0.6.33 |
doParallel | 1.0.17 |
downlit | 0.4.3 |
dplyr | 1.1.4 |
dqrng | 0.3.2 |
dtplyr | 1.3.1 |
ellipsis | 0.3.2 |
evaluate | 0.23 |
fansi | 1.0.6 |
farver | 2.1.1 |
fastmap | 1.1.1 |
FNN | 1.1.3.2 |
fontawesome | 0.5.2 |
forcats | 1.0.0 |
foreach | 1.5.2 |
forecast | 8.21.1 |
fracdiff | 1.5-2 |
fs | 1.6.3 |
furrr | 0.3.1 |
future | 1.33.0 |
future.apply | 1.11.0 |
gargle | 1.5.2 |
generics | 0.1.3 |
gert | 2.0.1 |
ggforce | 0.4.1 |
ggfun | 0.1.3 |
ggplot2 | 3.4.4 |
ggplotify | 0.1.2 |
ggraph | 2.1.0 |
ggrepel | 0.9.4 |
ggtree | 3.10.0 |
gh | 1.4.0 |
gitcreds | 0.1.2 |
globals | 0.16.2 |
glue | 1.6.2 |
googledrive | 2.1.1 |
googlesheets4 | 1.1.1 |
gower | 1.0.1 |
graphlayouts | 1.0.2 |
gridExtra | 2.3 |
gridGraphics | 0.5-1 |
gtable | 0.3.4 |
hardhat | 1.3.0 |
haven | 2.5.4 |
highr | 0.10 |
hms | 1.1.3 |
htmltools | 0.5.7 |
htmlwidgets | 1.6.4 |
httpuv | 1.6.13 |
httr | 1.4.7 |
httr2 | 1.0.0 |
ids | 1.0.1 |
igraph | 1.6.0 |
ini | 0.3.1 |
ipred | 0.9-14 |
irlba | 2.3.5.1 |
isoband | 0.2.7 |
iterators | 1.0.14 |
jquerylib | 0.1.4 |
jsonlite | 1.8.8 |
knitr | 1.45 |
labeling | 0.4.3 |
later | 1.3.2 |
lava | 1.7.3 |
lazyeval | 0.2.2 |
lifecycle | 1.0.4 |
listenv | 0.9.0 |
lme4 | 1.1-35.1 |
lmerTest | 3.1-3 |
lmtest | 0.9-40 |
lubridate | 1.9.3 |
magrittr | 2.0.3 |
MatrixModels | 0.5-3 |
memoise | 2.0.1 |
mime | 0.12 |
miniUI | 0.1.1.1 |
minqa | 1.2.6 |
modelr | 0.1.11 |
munsell | 0.5.0 |
nloptr | 2.0.3 |
numDeriv | 2016.8-1.1 |
openssl | 2.1.1 |
padr | 0.6.2 |
parallelly | 1.36.0 |
pastecs | 1.3.21 |
patchwork | 1.1.3 |
pbkrtest | 0.5.2 |
PerformanceAnalytics | 2.0.4 |
pillar | 1.9.0 |
pkgbuild | 1.4.3 |
pkgconfig | 2.0.3 |
pkgdown | 2.0.7 |
pkgload | 1.3.3 |
plotly | 4.10.3 |
plotrix | 3.8-4 |
plyr | 1.8.9 |
polyclip | 1.10-6 |
praise | 1.0.0 |
prettyunits | 1.2.0 |
processx | 3.8.3 |
prodlim | 2023.08.28 |
profvis | 0.3.8 |
progress | 1.2.3 |
progressr | 0.14.0 |
promises | 1.2.1 |
ps | 1.7.5 |
purrr | 1.0.2 |
quadprog | 1.5-8 |
Quandl | 2.11.0 |
quantmod | 0.4.25 |
quantreg | 5.97 |
R6 | 2.5.1 |
ragg | 1.2.7 |
rappdirs | 0.3.3 |
rcmdcheck | 1.4.0 |
RColorBrewer | 1.1-3 |
Rcpp | 1.0.11 |
RcppAnnoy | 0.0.21 |
RcppArmadillo | 0.12.6.6.1 |
RcppEigen | 0.3.3.9.4 |
RcppProgress | 0.4.2 |
RcppRoll | 0.3.0 |
readr | 2.1.4 |
readxl | 1.4.3 |
recipes | 1.0.9 |
rematch | 2.0.0 |
rematch2 | 2.1.2 |
remotes | 2.4.2.1 |
reprex | 2.0.2 |
reshape | 0.8.9 |
reshape2 | 1.4.4 |
riingo | 0.3.1 |
rlang | 1.1.2 |
RLRsim | 3.1-8 |
rmarkdown | 2.25 |
roxygen2 | 7.3.1 |
rprojroot | 2.0.4 |
rsample | 1.2.0 |
rstudioapi | 0.15.0 |
rversions | 2.1.2 |
rvest | 1.0.3 |
sass | 0.4.8 |
scales | 1.3.0 |
selectr | 0.4-2 |
sessioninfo | 1.2.2 |
shape | 1.4.6 |
shiny | 1.8.0 |
simr | 1.0.7 |
sitmo | 2.0.2 |
slider | 0.3.1 |
sourcetools | 0.1.7-1 |
SparseM | 1.81 |
SQUAREM | 2021.1 |
stringi | 1.8.3 |
stringr | 1.5.1 |
SuppDists | 1.1-9.7 |
sys | 3.4.2 |
systemfonts | 1.0.5 |
testthat | 3.2.1 |
textshaping | 0.3.7 |
tibble | 3.2.1 |
tidygraph | 1.3.0 |
tidyquant | 1.0.7 |
tidyr | 1.3.0 |
tidyselect | 1.2.0 |
tidytree | 0.4.6 |
tidyverse | 2.0.0 |
timechange | 0.2.0 |
timeDate | 4032.109 |
timetk | 2.9.0 |
tinytex | 0.49 |
treeio | 1.26.0 |
tseries | 0.10-55 |
tsfeatures | 1.1.1 |
TTR | 0.24.4 |
tweenr | 2.0.2 |
tzdb | 0.4.0 |
urca | 1.3-3 |
urlchecker | 1.0.1 |
usethis | 2.2.2 |
utf8 | 1.2.4 |
uuid | 1.1-1 |
uwot | 0.1.16 |
vctrs | 0.6.5 |
viridis | 0.6.4 |
viridisLite | 0.4.2 |
vroom | 1.6.5 |
waldo | 0.5.2 |
warp | 0.2.1 |
whisker | 0.4.1 |
withr | 2.5.2 |
xfun | 0.41 |
xml2 | 1.3.6 |
xopen | 1.0.0 |
xtable | 1.8-4 |
xts | 0.13.1 |
yaml | 2.3.8 |
yulab.utils | 0.1.1 |
zip | 2.3.1 |
zoo | 1.8-12 |
Eigene Pakete hinzufügen
R ermöglicht es, eigene bzw. zusätzliche Pakete in das Home-Verzeichnis zu installieren. Dazu muss zunächst von CRAN das gewünschte Source-Paket (im tar.gz-Format) herunterladen werden. Danach kann dies, z. B. in einem interaktiven Job, wie folgt installiert werden:
R-Modul laden
Codeblock | ||
---|---|---|
| ||
module load R/4.3.6.13-gcc |
Verzeichnis(se) für weitere Pakete anlegen (falls noch nicht geschehen)
Codeblock | ||
---|---|---|
| ||
mkdir -p ~/R/libs |
diesen neuen Pfad für R bekannt machen
Codeblock | ||
---|---|---|
| ||
echo 'R_LIBS_USER="~/R/libs"' >> $HOME/.Renviron |
neues Paket (als Beispiel mypackage.tar.gz) in diesen Pfad installieren
Codeblock | ||
---|---|---|
| ||
R CMD INSTALL -l ~/R/libs/ mypackage.tar.gz |
Sollen weitere Pakete installiert werden, dann erübrigen sich die ersten Schritte (insbesondere 2. und 3.).
Info | ||
---|---|---|
| ||
R scheint an dieser Stelle nur tar.gz-Archive zu verstehen. Leider bieten manche Download-Seiten aber nur andere Archiv-Formate, wie bspw. ZIP, zum Herunterladen an. Falls dies der Fall sein sollte, kann man mittels
|
Info | ||
---|---|---|
| ||
$ mkdir -p ~/R/libs |
It is possible in R to execute methods in parallel across multiple cores with the library 'parallel': https://dept.stat.lsa.umich.edu/~jerrick/courses/stat701/notes/parallel.html. The method detectCores
() returns incorrect numbers and should not be used. A good replacement is https://github.com/HenrikBengtsson/parallelly. Other To the best of our knowledge other commonly used R libraries for parallel Execution as 'doParallel', 'doSNOW' or 'foreach' are only addressing one core - to the best of out knowledge.
A second possibility is - if possible - seperating your job in the RScript into several tasks (below 200 tasks from 0 to 199).
Codeblock | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
#!/bin/bash #PBS -A YourProject #PBS -l select=1:ncpus=1:mem=8G #PBS -l walltime=01:59:00 #PBS -r y #PBS -J 0-199 module load R/4.03.32-gcc jobargs=$(echo "'--args ${PBS_ARRAY_INDEX}'") jobstr=$(echo "R CMD BATCH --no-save --no-restore ${jobargs} your_script.R your_script.Rout") eval ${jobstr} |
The job argument (0 to 199 in this example) can be used in your RScript as followed:
Codeblock | ||
---|---|---|
| ||
args = commandArgs(TRUE) ... |
Of course both ways to parallel processing using R can be combined by creating several jobs which use multiple cores with the library 'parallel'.
The Intel compiler, that we use to build R, conflicts with gcc headers when using complex data types, resulting in an error similar to the one below when installing some R libraries:
Codeblock |
---|
/software/intel/xe2019/compilers_and_libraries_2019.0.117/linux/compiler/include/complex(310): error #308: member "std::complex<double>::_M_value" (declared at line 1337 of "/usr/include/c++/4.8.5/complex") is inaccessible |
~/.R/Makevars
such as:Codeblock | ||||
---|---|---|---|---|
| ||||
CFLAGS += -wd308 CXXFLAGS += -wd308 CPPFLAGS += -wd308 PKG_CFLAGS += -wd308 PKG_CXXFLAGS += -wd308 PKG_CPPFLAGS += -wd308 |
Inhalt |
---|
verfügbare Versionen |
---|
3.0.2 |
3.2.3 |
3.3.2 |
3.5.3 |
3.6.1 |
4.0.3 |
4.2.2 |
4.3.2 |
4.3.3 |