The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Installation

Fedora

The newest R release (including recommended packages as well as development headers and tools) can be installed by running

$ sudo dnf install R

or yum instead of dnf for older EPEL versions. This ‘R’ RPM is a meta-package. It has no content but ensures that the following components are installed

Component Description
R-core The minimal R components necessary for a functional runtime
R-core-devel Core files for development of R packages (no Java)
R-java R with Fedora-provided Java Runtime Environment
R-java-devel Development package for use with Java enabled R components
libRmath Standalone math library from the R project
libRmath-devel Headers from the R standalone math library

This division enables minimal installations (e.g., with no Java, with no development tools…), but generally R users will need all the components to be able to install any package from source. Therefore, it is recommended to install the ‘R’ meta-package.

EPEL for CentOS and RHEL

The Fedora RPMs for R have been ported to CentOS/RHEL by the project Extra Packages for Enterprise Linux (EPEL). These RPMs are also compatible with distributions derived from CentOS/RHEL.

To use the EPEL repository, it is sufficient to download and install the appropriate “epel-release” RPM, as described in the EPEL FAQ. Then R can be installed as described above.

Administration and maintenance

The R installation is divided in two directories:

In the same way,

Additionally, the R installation adds the following paths:

For example, these are the library paths for a x86_64 machine with R 4.0 installed:

.libPaths()
#> [1] "/home/<user>/R/x86_64-redhat-linux-gnu-library/4.0"
#> [2] "/usr/local/lib/R/library"
#> [3] "/usr/lib64/R/library"
#> [4] "/usr/share/R/library"

Supported packages

Recommended R packages are included as part of the R-core component. A number of add-on packages from CRAN, Bioconductor and other sources are readily available via the official repositories. Hence, running

$ dnf repoquery --repo=fedora-source R-*

provides a comprehensive list.

The listing below shows all RPMs available for R packages on Fedora 34 (Thirty Four), classified by the R repository that would normally be used to install the package from within R (see the help page ?chooseRepositories).

Click to toggle the list of packages

## $CRAN
##   [1] "abind"             "acepack"           "ape"              
##   [4] "argon2"            "arules"            "ascii"            
##   [7] "askpass"           "assertthat"        "AUC"              
##  [10] "backports"         "base64enc"         "bench"            
##  [13] "Bessel"            "biglm"             "bindr"            
##  [16] "bindrcpp"          "bit"               "bit64"            
##  [19] "bitops"            "blob"              "bookdown"         
##  [22] "brew"              "brio"              "broom"            
##  [25] "cachem"            "Cairo"             "callr"            
##  [28] "car"               "caTools"           "cellranger"       
##  [31] "chron"             "cli"               "cliapp"           
##  [34] "clipr"             "clisymbols"        "coda"             
##  [37] "colorspace"        "combinat"          "commonmark"       
##  [40] "conflicted"        "corpus"            "covr"             
##  [43] "cpp11"             "crayon"            "credentials"      
##  [46] "crosstalk"         "curl"              "cyclocomp"        
##  [49] "data.table"        "date"              "DBI"              
##  [52] "DBItest"           "dbplyr"            "debugme"          
##  [55] "deldir"            "desc"              "devtools"         
##  [58] "dichromat"         "diffobj"           "digest"           
##  [61] "disposables"       "doMC"              "doParallel"       
##  [64] "downlit"           "dplyr"             "DT"               
##  [67] "dtplyr"            "ellipsis"          "errors"           
##  [70] "evaluate"          "expm"              "fansi"            
##  [73] "farver"            "fastmap"           "fastmatch"        
##  [76] "filehash"          "filelock"          "flexiblas"        
##  [79] "FMStable"          "foghorn"           "fontBitstreamVera"
##  [82] "fontLiberation"    "forcats"           "foreach"          
##  [85] "formatR"           "formattable"       "fortunes"         
##  [88] "fs"                "fts"               "futile.logger"    
##  [91] "futile.options"    "future"            "gamlss.dist"      
##  [94] "gapminder"         "gargle"            "gdata"            
##  [97] "gdtools"           "gee"               "geepack"          
## [100] "generics"          "gert"              "getPass"          
## [103] "ggplot2"           "ggplot2movies"     "gh"               
## [106] "git2r"             "gitcreds"          "globals"          
## [109] "glue"              "gmailr"            "gmp"              
## [112] "gplots"            "gsl"               "gss"              
## [115] "gtable"            "gtools"            "haven"            
## [118] "here"              "hexbin"            "highlight"        
## [121] "highr"             "hms"               "htmltools"        
## [124] "htmlwidgets"       "httpuv"            "httr"             
## [127] "hunspell"          "igraph"            "import"           
## [130] "ini"               "inline"            "IRdisplay"        
## [133] "IRkernel"          "isoband"           "iterators"        
## [136] "itertools"         "jose"              "jpeg"             
## [139] "jqr"               "jsonlite"          "keyring"          
## [142] "knitr"             "labeling"          "lambda.r"         
## [145] "later"             "lazyeval"          "lifecycle"        
## [148] "lintr"             "listenv"           "littler"          
## [151] "lmodel2"           "lmtest"            "lobstr"           
## [154] "lokern"            "lpSolve"           "lubridate"        
## [157] "magick"            "magrittr"          "mapproj"          
## [160] "maps"              "mAr"               "markdown"         
## [163] "matrixStats"       "measurements"      "memoise"          
## [166] "microbenchmark"    "mime"              "miniUI"           
## [169] "mlbench"           "mnormt"            "mockery"          
## [172] "mockr"             "modelr"            "msm"              
## [175] "multcomp"          "munsell"           "mvtnorm"          
## [178] "nanotime"          "ncdf4"             "NISTunits"        
## [181] "nycflights13"      "odbc"              "openssl"          
## [184] "orcutt"            "oskeyring"         "packrat"          
## [187] "pak"               "parallelly"        "parsedate"        
## [190] "pbdRPC"            "pbdZMQ"            "pdftools"         
## [193] "pillar"            "pingr"             "pkgbuild"         
## [196] "pkgcache"          "pkgconfig"         "pkgdown"          
## [199] "pkgload"           "plogr"             "plyr"             
## [202] "png"               "poLCA"             "polyclip"         
## [205] "polynom"           "praise"            "presser"          
## [208] "prettycode"        "prettydoc"         "prettyunits"      
## [211] "processx"          "procmaps"          "profmem"          
## [214] "profvis"           "progress"          "promises"         
## [217] "ps"                "purrr"             "qcc"              
## [220] "qpdf"              "qtl"               "quadprog"         
## [223] "quantities"        "R.cache"           "R.devices"        
## [226] "R.methodsS3"       "R.oo"              "R.rsp"            
## [229] "R.utils"           "R6"                "ragg"             
## [232] "randomForest"      "rappdirs"          "rcmdcheck"        
## [235] "RColorBrewer"      "Rcpp"              "RcppCCTZ"         
## [238] "RcppDate"          "RCurl"             "readr"            
## [241] "readxl"            "rematch"           "rematch2"         
## [244] "remotes"           "repr"              "reprex"           
## [247] "repurrrsive"       "reshape"           "reshape2"         
## [250] "reticulate"        "rex"               "rgdal"            
## [253] "rgeos"             "RhpcBLASctl"       "rhub"             
## [256] "RInside"           "rlang"             "rle"              
## [259] "rlecuyer"          "RM2"               "RMariaDB"         
## [262] "rmarkdown"         "Rmpfr"             "RODBC"            
## [265] "roxygen2"          "RPostgres"         "rprintf"          
## [268] "rprojroot"         "rsconnect"         "RSQLite"          
## [271] "rstudioapi"        "rsvg"              "RUnit"            
## [274] "rversions"         "rvest"             "sandwich"         
## [277] "scales"            "scatterplot3d"     "sciplot"          
## [280] "selectr"           "servr"             "sessioninfo"      
## [283] "sfsmisc"           "shiny"             "showtext"         
## [286] "showtextdb"        "simmer"            "snow"             
## [289] "sodium"            "sourcetools"       "sp"               
## [292] "spelling"          "statnet.common"    "stringdist"       
## [295] "stringi"           "stringr"           "styler"           
## [298] "svglite"           "sys"               "sysfonts"         
## [301] "systemfit"         "systemfonts"       "tesseract"        
## [304] "testit"            "testthat"          "textshaping"      
## [307] "TH.data"           "tibble"            "tidyr"            
## [310] "tidyselect"        "tikzDevice"        "timeDate"         
## [313] "timeSeries"        "tinytest"          "tinytex"          
## [316] "tkrplot"           "tmvnsim"           "tufte"            
## [319] "tweenr"            "udunits2"          "unitizer"         
## [322] "units"             "unix"              "usethis"          
## [325] "utf8"              "uuid"              "V8"               
## [328] "vctrs"             "viridisLite"       "waldo"            
## [331] "waveslim"          "wavethresh"        "webp"             
## [334] "websocket"         "webutils"          "wesanderson"      
## [337] "whisker"           "whoami"            "winch"            
## [340] "withr"             "xfun"              "XML"              
## [343] "xml2"              "xmlparsedata"      "xopen"            
## [346] "xtable"            "yaml"              "zeallot"          
## [349] "zip"               "zoo"              
## 
## $`BioC software`
##  [1] "affyio"               "AnnotationDbi"        "Biobase"             
##  [4] "BiocFileCache"        "BiocGenerics"         "BiocParallel"        
##  [7] "biomaRt"              "Biostrings"           "BSgenome"            
## [10] "BufferedMatrix"       "DelayedArray"         "DynDoc"              
## [13] "GenomeInfoDb"         "GenomicAlignments"    "GenomicRanges"       
## [16] "IRanges"              "MatrixGenerics"       "preprocessCore"      
## [19] "qvalue"               "Rhtslib"              "Rsamtools"           
## [22] "rtracklayer"          "S4Vectors"            "SummarizedExperiment"
## [25] "tkWidgets"            "widgetTools"          "XVector"             
## 
## $`BioC annotation`
## [1] "GenomeInfoDbData"
## 
## $Omegahat
## [1] "Rcompression" "RCurl"        "XML"         
## 
## $`R-Forge`
##  [1] "abind"         "Bessel"        "bit"           "bit64"        
##  [5] "brew"          "car"           "colorspace"    "data.table"   
##  [9] "date"          "dichromat"     "digest"        "doMC"         
## [13] "doParallel"    "expm"          "foreach"       "fortunes"     
## [17] "gamlss.dist"   "gdata"         "gplots"        "gtools"       
## [21] "highlight"     "htmltools"     "iterators"     "itertools"    
## [25] "labeling"      "lmodel2"       "lokern"        "matrixStats"  
## [29] "msm"           "multcomp"      "mvtnorm"       "NISTunits"    
## [33] "randomForest"  "Rcpp"          "rgdal"         "rgeos"        
## [37] "Rmpfr"         "sandwich"      "scatterplot3d" "stringi"      
## [41] "systemfit"     "TH.data"       "tikzDevice"    "timeDate"     
## [45] "timeSeries"    "waveslim"      "xtable"        "zoo"          
## 
## $rforge.net
##  [1] "Cairo"      "base64enc"  "brew"       "evaluate"   "fastmatch" 
##  [6] "formatR"    "highr"      "jpeg"       "knitr"      "markdown"  
## [11] "mime"       "png"        "servr"      "testit"     "tikzDevice"
## [16] "uuid"      
## 
## $Other
## [1] "Rsolid" "nws"

Note that the classification is not mutually exclusive (e.g. R-RCurl appears several times) and that there are RPMs that are not available from any standard R repository. These are listed under “Other”.

Additional packages

The cran2copr project maintains binary RPM repositories for the current and previous stable Fedora version for most of CRAN (more than 17k packages as of Aug. 2021) in an automated way using Fedora Copr.

These repositories are automatically synchronized with CRAN every day at 00:00 UTC through a GitHub Action that removes archived packages and builds the most recent updates. To ensure compatibility with the official repositories, these set of packages are named “R-CRAN-pkgname” (instead of “R-pkgname”), and are installed into /usr/local/lib/R/library.

To enable this Copr repository in your system:

$ sudo dnf install 'dnf-command(copr)'
$ sudo dnf copr enable iucar/cran
$ sudo dnf install R-CoprManager

The last command is optional, but recommended, because the CoprManager package integrates binary package installation into your R session. In this way, you can install or update packages in R as you normally do, e.g.,

install.packages("car")
update.packages(ask=FALSE)

in the R console, and packages will be automatically installed from the Copr repository. If a package is not available, then it just falls back to normal installation from CRAN.

On the other hand, remove.packages will still remove only packages installed in your user library. If you want to remove system packages, run:

CoprManager::remove_copr("car")

If you want to disable the CoprManager, so that install.packages only works with CRAN again, then run:

CoprManager::disable()
install.packages("car") # from CRAN to user lib

BLAS/LAPACK switching

Since Fedora 33, R (as well as Numpy, Octave and all the other BLAS/LAPACK consumers) is linked against FlexiBLAS, a BLAS/LAPACK wrapper library that enables runtime switching of the optimized backend (see the change proposal for further details), and the OpenMP version of OpenBLAS is set as the default backend.

The accompanying flexiblas R package enables BLAS/LAPACK switching without leaving the R session, as well as setting the number of threads for parallel backends (see the package’s README for further information).

$ sudo dnf install R-flexiblas # install FlexiBLAS API interface for R
$ sudo dnf install flexiblas-* # install all available optimized backends

Then, in an R session we see:

library(flexiblas)

# check whether FlexiBLAS is available
flexiblas_avail()
#> [1] TRUE

# get the current backend
flexiblas_current_backend()
#> [1] "OPENBLAS-OPENMP"

# list all available backends
flexiblas_list()
#> [1] "NETLIB"           "__FALLBACK__"     "BLIS-THREADS"     "OPENBLAS-OPENMP"
#> [5] "BLIS-SERIAL"      "ATLAS"            "OPENBLAS-SERIAL"  "OPENBLAS-THREADS"
#> [9] "BLIS-OPENMP"

# get/set the number of threads
flexiblas_set_num_threads(12)
flexiblas_get_num_threads()
#> [1] 12

This is an example of GEMM benchmark for all the backends available:

library(flexiblas)

n <- 2000
runs <- 10
ignore <- "__FALLBACK__"

A <- matrix(runif(n*n), nrow=n)
B <- matrix(runif(n*n), nrow=n)

# load backends
backends <- setdiff(flexiblas_list(), ignore)
idx <- flexiblas_load_backend(backends)

# benchmark
timings <- sapply(idx, function(i) {
  flexiblas_switch(i)

  # warm-up
  C <- A[1:100, 1:100] %*% B[1:100, 1:100]

  unname(system.time({
    for (j in seq_len(runs))
      C <- A %*% B
  })[3])
})

results <- data.frame(
  backend = backends,
  `timing [s]` = timings,
  `performance [GFlops]` = (2 * (n / 1000)^3) / timings,
  check.names = FALSE)

results[order(results$performance),]
#>            backend timing [s] performance [GFlops]
#> 1           NETLIB     56.776            0.2818092
#> 5            ATLAS      5.988            2.6720107
#> 2     BLIS-THREADS      3.442            4.6484602
#> 8      BLIS-OPENMP      3.408            4.6948357
#> 4      BLIS-SERIAL      3.395            4.7128130
#> 6  OPENBLAS-SERIAL      3.206            4.9906425
#> 7 OPENBLAS-THREADS      0.773           20.6985770
#> 3  OPENBLAS-OPENMP      0.761           21.0249671

Add-ons

The following add-ons are available in the official repositories:

Component Description
rstudio-desktop Integrated development environment for the R language
rstudio-server Access RStudio via a web browser
rkward Graphical front-end for the R language
emacs-ess Emacs Speaks Statistics under GNU Emacs

Containerized environments

Fedora Docker images

There are official Fedora Docker images, maintained by the Fedora Release Engineering team, that can be used as base images for containerized R applications (for cloud deployments, CI/CD systems…). All the instructions above apply too for installation and maintenance of R software in these Docker images. However, you may see the following warning when installing R packages from source:

Warning in file.create(f.tg) :
 cannot create file '/usr/share/doc/R/html/packages.html', reason 'No
such file or directory'
Warning in utils::make.packages.html(.Library, docdir = R.home("doc")) :
 cannot update HTML package index

This is expected, because base Docker images add tsflags=nodocs to /etc/dnf/dnf.conf in order to minimize image sizes, and thus some documentation is missing in the R installation. However, this warning is completely harmless and can be safely ignored. If you still want to silence this warning, there are two options:

  • Installing R-core with --setopt=tsflags= will reset tsflags and thus will install R’s docs.
  • Installing source R packages with --no-docs does not issue any warning.

If you are using an old version of devtools or remotes to install R packages, the warning above may have turned into an error like the following:

Error in file.copy(file.path(R.home("doc"), "html", "R.css"), outman) :
  (converted from warning) problem copying /usr/share/doc/R/html/R.css
to /usr/lib64/R/library/00LOCK-<package>/00new/<package>/html/R.css:
No such file or directory

This is a known issue that should be fixed in recent releases. Otherwise, setting the environment variable R_REMOTES_NO_ERRORS_FROM_WARNINGS=true should avoid turning installation warnings to errors.

Toolbox: container-based development

Toolbox enables a rootless containerized environment for everyday software development. It is best suited for immutable operating systems, such as Fedora Silverblue, but it can be used in any Fedora or CentOS/RedHat base system. It could be used as the main development environment to avoid installing anything in the base system, or e.g. to test a new R release only available in Fedora rawhide without polluting the main installation.

As an example, let us suppose that the base system runs R 4.0 on Fedora 34, and we want to test R 4.1, available in rawhide, before Fedora 35 is released:

$ sudo dnf install toolbox
$ toolbox enter --release 35
[toolbox]$ sudo dnf install R
[toolbox]$ R

R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

Note that users do not need any administrative rights to install anything in their toolboxes. Once R is installed in the toolbox, it can be directly executed without entering first:

$ toolbox run --release 35 R

Your favorite IDE must be installed in the toolbox too in order to connect to the R installation there. GUIs such as RStudio Desktop should simply work:

[toolbox]$ sudo dnf install rstudio-desktop
[toolbox]$ rstudio

However, if you experience blank screens or interface glitches, a workaround is to use the Server version as follows:

[toolbox]$ sudo dnf install rstudio-server
[toolbox]$ rserver --server-daemonize=0 --auth-none=1 --server-user=$(whoami)

then, open any web browser and navigate to localhost:8787.

See this introduction to Toolbox on Fedora as well as the documentation (man toolbox) for further information.

Reporting Problems

The best place to report problems with these packages or ask R questions specific to Fedora/EPEL is the R-SIG-Fedora mailing list. See https://stat.ethz.ch/mailman/listinfo/r-sig-fedora for more information.

Acknowledgements

Thanks to Martyn Plummer for maintaining a previous version of this page. The R stack for Fedora/EPEL is maintained by Tom “Spot” Callaway, Elliott Sales de Andrade, José Abílio Matos and Mattias Ellert among others. Additional CRAN RPMs for Fedora (17k+) are maintained by Iñaki Ucar, built and distributed through Fedora Copr. The Copr Build System is maintained by Miroslav Suchý, Pavel Raiskup, Jakub Kadlcik and many others. Thanks to Martin Koehler and Fabio Valentini for their invaluable assistance in bringing FlexiBLAS to Fedora.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.