R package#Other packages

{{short description|Extensions to the R statistical programming language}}

File:R logo.svg

R packages are extensions to the R statistical programming language. R packages contain code, data, and documentation in a standardised collection format that can be installed by users of R, typically via a centralised software repository such as CRAN (the Comprehensive R Archive Network).{{cite web|last1=Hornik|first1=Kurt|date=2020-02-20|title=Frequently Asked Questions on R|url=https://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages|access-date=2 November 2020|website=The Comprehensive R Archive Network|location=7.29: What is the difference between package and library?|archive-date=2011-07-09|archive-url=https://web.archive.org/web/20110709085359/http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages|url-status=live}}{{cite book |last1=Wickham |first1=Hadley |last2=Bryan |first2=Jennifer |title=R Packages |edition=2nd |url=https://r-pkgs.org/intro.html |chapter=Introduction |access-date=2020-11-02 |archive-date=2022-06-29 |archive-url=https://web.archive.org/web/20220629062757/https://r-pkgs.org/intro.html |url-status=live }} The large number of packages available for R, and the ease of installing and using them, has been cited as a major factor driving the widespread adoption of the language in data science.{{Cite journal|last=Chambers|first=John M.|date=2020|title=S, R, and Data Science|url=https://journal.r-project.org/archive/2020/RJ-2020-028/index.html|journal=The R Journal|language=en|volume=12|issue=1|pages=462–476|doi=10.32614/RJ-2020-028|issn=2073-4859|doi-access=free|access-date=2020-11-02|archive-date=2020-11-01|archive-url=https://web.archive.org/web/20201101065701/https://journal.r-project.org/archive/2020/RJ-2020-028/index.html|url-status=live}}{{cite news|last=Vance|first=Ashlee|author-link=Ashlee Vance|date=2009-01-06|title=Data Analysts Captivated by R's Power|work=New York Times|url=https://www.nytimes.com/2009/01/07/technology/business-computing/07program.html|access-date=2020-11-02|archive-date=2021-05-02|archive-url=https://web.archive.org/web/20210502082437/https://www.nytimes.com/2009/01/07/technology/business-computing/07program.html|url-status=live}}{{Cite journal|last=Tippmann|first=Sylvia|date=2014-12-29|title=Programming tools: Adventures with R|journal=Nature News|language=en|volume=517|issue=7532|pages=109–110|doi=10.1038/517109a|pmid=25557714 |doi-access=free}}{{Cite journal|last=Thieme|first=Nick|date=2018|title=R generation|journal=Significance|language=en|volume=15|issue=4|pages=14–19|doi=10.1111/j.1740-9713.2018.01169.x|issn=1740-9713|doi-access=free}}

Compared to libraries in other programming languages, R packages must conform to a relatively strict specification. The Writing R Extensions manual{{Cite web|title=Writing R Extensions|url=https://cran.r-project.org/doc/manuals/r-release/R-exts.html|access-date=2020-11-02|website=The Comprehensive R Archive Network|archive-date=2020-11-12|archive-url=https://web.archive.org/web/20201112034046/https://cran.r-project.org/doc/manuals/r-release/R-exts.html|url-status=live}} specifies a standard directory structure for R source code, data, documentation, and package metadata, which enables them to be installed and loaded using R's in-built package management tools. Packages distributed on CRAN must meet additional standards.{{Cite web|title=CRAN Repository Policy|url=https://cran.r-project.org/web/packages/policies.html|access-date=2020-11-02|website=The Comprehensive R Archive Network|archive-date=2020-11-05|archive-url=https://web.archive.org/web/20201105093336/https://cran.r-project.org/web/packages/policies.html|url-status=live}} According to John Chambers, whilst these requirements "impose considerable demands" on package developers, they improve the usability and long-term stability of packages for end users.

Repositories

= Comprehensive R Archive Network (CRAN) =

File:CRAN_homepage.png

The Comprehensive R Archive Network (CRAN) is R's central software repository, supported by the R Foundation.{{cite web |author1=CRAN Repository Maintainers |title=CRAN Repository Policy |url=https://cran.r-project.org/web/packages/policies.html |website=The Comprehensive R Archive Network |publisher=R Project |access-date=20 November 2020 |archive-date=11 November 2020 |archive-url=https://web.archive.org/web/20201111222757/https://cran.r-project.org/web/packages/policies.html |url-status=live }} It contains an archive of the latest and previous versions of the R distribution, documentation, and contributed R packages.{{cite web|last1=Hornik|first1=Kurt|date=2020-02-20|title=Frequently Asked Questions on R|url=https://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-CRAN_003f|access-date=20 November 2020|website=The Comprehensive R Archive Network|publisher=R Project|location=2.1: What is CRAN?|archive-date=2011-07-09|archive-url=https://web.archive.org/web/20110709085359/http://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-CRAN_003f|url-status=live}} It includes both source packages and pre-compiled binaries for Windows and macOS.{{cite web |author=CRAN Repository Maintainers |title=The Comprehensive R Archive Network |url=https://cran.r-project.org/ |publisher=R Project |access-date=20 November 2020 |archive-date=23 January 2019 |archive-url=https://web.archive.org/web/20190123091845/https://cran.r-project.org/ |url-status=live }} {{As of|November 2020}}, more than 16,000 packages are available.{{cite web |author=CRAN Repository Maintainers |title=CRAN - Contributed Packages |url=https://cran.r-project.org/web/packages |website=The Comprehensive R Archive Network |publisher=CRAN |access-date=20 November 2020 |archive-date=24 November 2020 |archive-url=https://web.archive.org/web/20201124034305/http://cran.r-project.org/web/packages/ |url-status=live }} CRAN was created by Kurt Hornik and Friedrich Leisch in 1997,{{cite mailing list |url=https://stat.ethz.ch/pipermail/r-announce/1997/000001.html |title=ANNOUNCE: CRAN |date=1997-04-23 |access-date=20 November 2020 |mailing-list=r-announce |last=Hornik |first=Kurt |author-link=Kurt Hornik |archive-date=2021-03-08 |archive-url=https://web.archive.org/web/20210308080935/https://stat.ethz.ch/pipermail/r-announce/1997/000001.html |url-status=live }}{{cite journal |last1=Thieme |first1=Nick |title=R generation |journal=Significance |date=2018 |volume=15 |issue=4 |pages=14–19 |doi=10.1111/j.1740-9713.2018.01169.x |language=en |issn=1740-9713|doi-access=free }} with the name paralleling other early packing systems such as TeX's CTAN (released 1992) and Perl's CPAN (released 1995).{{cite web |last1=Fitzgerald |first1=Brian |title=A Survey of Programming Language Package Systems |url=https://neurocline.github.io/papers/survey-of-programming-language-packaging-systems.html |website=Some Things Are Obvious |access-date=4 May 2021 |date=2016-02-09 |archive-date=2020-11-09 |archive-url=https://web.archive.org/web/20201109001211/http://neurocline.github.io/papers/survey-of-programming-language-packaging-systems.html |url-status=live }} {{As of|2021}}, it is still maintained by Hornik and a team of volunteers. The master site is located at the Vienna University of Economics and Business and is mirrored on servers around the world.

File:R_Task_Views_Homepage.png

The "Task Views" page (subject list) on the CRAN website{{cite web|title=CRAN Task Views|url=https://cran.r-project.org/web/views/|website=cran.r-project.org|access-date=2018-09-16|archive-date=2011-07-09|archive-url=https://web.archive.org/web/20110709090110/http://cran.r-project.org/web/views/|url-status=live}} lists a wide range of tasks (in fields such as finance, genetics, high performance computing, machine learning, medical imaging, meta-analysis, social sciences and spatial statistics) for which R packages are available. Another way to browse CRAN packages is provided by Metacran, which also maintains lists of featured, most downloaded, trending or most depended upon packages.

The number of CRAN packages has grown exponentially for many years,{{Cite web|date=April 21, 2016|first=Matt|last=Asay|title=Exponential growth of R's open source community threatens commercial competitors|url=https://www.techrepublic.com/article/exponential-growth-of-rs-open-source-community-threatens-commercial-competitors/|access-date=2020-11-02|website=TechRepublic|language=en|archive-date=2020-10-26|archive-url=https://web.archive.org/web/20201026135007/https://www.techrepublic.com/article/exponential-growth-of-rs-open-source-community-threatens-commercial-competitors/|url-status=live}} and {{As of|2018|lc=y}} an average of 21 submissions of new or updated packages were made every day. Since each submission is manually reviewed by a small team of CRAN maintainers, many of whom, according to R core developer Peter Dalgaard, are "approaching pensionable age", there is a concern that this system is not sustainable in the long term. The growth of CRAN has exposed limitations of its dependency management infrastructure, particularly the fact that it assumes that dependencies always refer to the latest version of a package, meaning that new releases of CRAN packages must always be backwards compatible,{{Cite journal|last=Ooms|first=Jeroen|date=2013|title=Possible Directions for Improving Dependency Versioning in R|url=https://journal.r-project.org/archive/2013/RJ-2013-019/index.html|journal=The R Journal|language=en|volume=5|issue=1|pages=197–206|doi=10.32614/RJ-2013-019|s2cid=6791850|issn=2073-4859|doi-access=free|access-date=2020-11-02|archive-date=2020-09-19|archive-url=https://web.archive.org/web/20200919032710/https://journal.r-project.org/archive/2013/RJ-2013-019/index.html|url-status=live|arxiv=1303.2140}} and that CRAN packages cannot have dependencies that are not on CRAN.{{Cite book|last1=Decan|first1=A.|last2=Mens|first2=T.|last3=Claes|first3=M.|last4=Grosjean|first4=P.|title=2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER)|chapter=When GitHub Meets CRAN: An Analysis of Inter-Repository Package Dependency Problems|date=2016|chapter-url=https://ieeexplore.ieee.org/document/7476669|volume=1|pages=493–504|doi=10.1109/SANER.2016.12|isbn=978-1-5090-1855-0|s2cid=16751624|access-date=2021-05-12|archive-date=2021-01-16|archive-url=https://web.archive.org/web/20210116084041/https://ieeexplore.ieee.org/document/7476669/|url-status=live}} It has also led to concerns about declining quality of packages.{{Cite journal|last=Hornik|first=Kurt|date=2012|title=Are There Too Many R Packages?|url=https://www.ajs.or.at/index.php/ajs/article/view/vol41%2C%20no1%20-%205|journal=Austrian Journal of Statistics|language=en|volume=41|issue=1|pages=59–66–59–66|doi=10.17713/ajs.v41i1.188|issn=1026-597X|doi-access=free|access-date=2020-11-02|archive-date=2020-11-26|archive-url=https://web.archive.org/web/20201126100052/https://ajs.or.at/index.php/ajs/article/view/vol41%2C%20no1%20-%205|url-status=live}}

=MRAN and Posit Package Manager=

File:MRAN_homepage.png

The Microsoft R Application Network (MRAN) is a mirror of CRAN maintained by Microsoft which is based on the company's downstream distribution of R, Microsoft R Open (formerly Revolution R Open).{{cite web |title=Welcome to MRAN |url=https://mran.microsoft.com/ |website=Microsoft R Application Network |publisher=Microsoft |access-date=4 May 2021 |archive-date=4 May 2021 |archive-url=https://web.archive.org/web/20210504233105/https://mran.microsoft.com/ |url-status=live }} It also includes an archive of daily CRAN snapshots, branded as the "CRAN Time Machine", which enables users of MRAN to bypass the dependency versioning limitations of CRAN by installing a fixed set of R package versions via the package checkpoint.{{cite web |title=Reproducibility: Using Fixed CRAN Repository Snapshots |url=https://mran.microsoft.com/documents/rro/reproducibility |website=Microsoft R Application Network |publisher=Microsoft |access-date=4 May 2021 |archive-date=2 May 2021 |archive-url=https://web.archive.org/web/20210502235101/https://mran.microsoft.com/documents/rro/reproducibility |url-status=live }}{{cite web |last1=Smith |first1=David |title=MRAN snapshots, and you |url=https://blog.revolutionanalytics.com/2019/05/cran-snapshots-and-you.html |website=Revolutions |publisher=Revolution Analytics |access-date=4 May 2021 |date=2019-05-22 |archive-date=2021-05-04 |archive-url=https://web.archive.org/web/20210504113027/https://blog.revolutionanalytics.com/2019/05/cran-snapshots-and-you.html |url-status=live }} In January 2023 Microsoft announced that MRAN was being retired and the associated websites and repositories became unavailable in July 2023.{{Cite web |title=Microsoft R Application Network retirement |url=https://techcommunity.microsoft.com/t5/azure-sql-blog/microsoft-r-application-network-retirement/ba-p/3707161 |access-date=2023-11-15 |website=techcommunity.microsoft.com |language=en}}

File:Posit_package_manager_homepage.png

The Posit Package Manager (formerly RStudio Package Manager) is a similar tool produced by the developers of RStudio which, in addition to CRAN snapshots, includes an archive of R packages from Bioconductor and Python packages from the Python Package Index.{{cite web |last1=Lopp |first1=Sean |title=RStudio Package Manager 1.2.0 - Bioconductor & PyPI |url=https://blog.rstudio.com/2020/12/07/package-manager-1-2-0/ |website=RStudio Blog |publisher=RStudio |access-date=4 May 2021 |language=en-us |date=2020-12-07 |archive-date=2021-05-04 |archive-url=https://web.archive.org/web/20210504113028/https://blog.rstudio.com/2020/12/07/package-manager-1-2-0/ |url-status=live }} It also distributes pre-compiled binary packages for Linux (only Windows and macOS binaries are included on CRAN).{{cite web |last1=Lopp |first1=Sean |title=Announcing Public Package Manager and v1.1.6 |url=https://blog.rstudio.com/2020/07/01/announcing-public-package-manager/ |access-date=4 May 2021 |website=RStudio Blog |publisher=RStudio |date=2020-07-01 |language=en-us |archive-date=2021-05-04 |archive-url=https://web.archive.org/web/20210504155150/https://blog.rstudio.com/2020/07/01/announcing-public-package-manager/ |url-status=live }}

= Other repositories =

The Bioconductor project provides R packages for the analysis of genomic data. This includes object-oriented data-handling and analysis tools for data from Affymetrix, cDNA microarray, and next-generation high-throughput sequencing methods.{{cite journal |date=2015 |title=Orchestrating high-throughput genomic analysis with Bioconductor |journal=Nature Methods |publisher=Nature Publishing Group |volume=12 |issue=2 |pages=115–121 |doi=10.1038/nmeth.3252 |pmid=25633503 |pmc=4509590 | last1 = Huber | first1 = W | last2 = Carey | first2 = VJ | last3 = Gentleman | first3 = R |author-link3= Robert Gentleman (statistician)| last4 = Anders | first4 = S | last5 = Carlson | first5 = M | last6 = Carvalho | first6 = BS | last7 = Bravo | first7 = HC | last8 = Davis | first8 = S | last9 = Gatto | first9 = L | last10 = Girke | first10 = T | last11 = Gottardo | first11 = R | last12 = Hahne | first12 = F | last13 = Hansen | first13 = KD | last14 = Irizarry | first14 = RA |author-link14=Rafael Irizarry (scientist) | last15 = Lawrence | first15 = M | last16 = Love | first16 = MI | last17 = MacDonald | first17 = J | last18 = Obenchain | first18 = V | last19 = Oleś | first19 = AK | last20 = Pagès | first20 = H | last21 = Reyes | first21 = A | last22 = Shannon | first22 = P | last23 = Smyth | first23 = GK | last24 = Tenenbaum | first24 = D | last25 = Waldron | first25 = L | last26 = Morgan | first26 = M}}

File:R-Forge_Homepage.png

R-Forge,{{cite web|url=https://r-forge.r-project.org/|title=R-Forge: Welcome|access-date=2018-09-16|archive-date=2018-09-14|archive-url=https://web.archive.org/web/20180914122834/http://r-forge.r-project.org/|url-status=live}} is a central platform for the collaborative development of R packages, R-related software, and projects. R-Forge also hosts many unpublished beta packages, and development versions of CRAN packages.

Other packages

A group of packages called the tidyverse, which can be considered a "dialect of the R language", is increasingly popular in the R ecosystem. As of 15 May 2025, Metacran listed 6 of the 8 core packages of the tidyverse in the list of most downloaded R packages.{{cite web|url=https://www.r-pkg.org/downloaded|title=Metacran|access-date=2021-05-04|archive-date=2021-04-20|archive-url=https://web.archive.org/web/20210420031909/https://www.r-pkg.org/downloaded|url-status=live}} The group of packages strives to provide a cohesive collection of functions to deal with common data science tasks, including data import, cleaning, transformation and visualisation (notably with the ggplot2 package).

The R Infrastructure packages support coding and the development of R packages and as of 4 May 2021, Metacran lists 16 of these packages among the 25 most downloaded packages.{{cite web|url=https://github.com/r-lib|title=R infrastructure|website=GitHub|access-date=2021-05-04|archive-date=2021-05-19|archive-url=https://web.archive.org/web/20210519104723/https://github.com/r-lib|url-status=live}}

See also

References

{{Reflist}}

Further reading

  • {{Cite book |last1=Wickham |first1=Hadley |url=https://r-pkgs.org/ |title=R Packages: Organize, Test, Document, and Share Your Code |last2=Bryan |first2=Jennifer |date=July 25, 2023 |publisher=O'Reilly |isbn=978-1098134945 |edition=2nd |location=}}
  • {{Cite book|last1=Claes|first1=M.|last2=Mens|first2=T.|last3=Grosjean|first3=P.|title=2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE) |chapter=On the maintainability of CRAN packages |date=2014|chapter-url=https://ieeexplore.ieee.org/document/6747183|pages=308–312|doi=10.1109/CSMR-WCRE.2014.6747183|isbn=978-1-4799-3752-3|s2cid=17927576}}
  • {{Cite book|last1=Decan|first1=Alexandre|last2=Mens|first2=Tom|last3=Claes|first3=Maelick|last4=Grosjean|first4=Philippe|title=Proceedings of the 2015 European Conference on Software Architecture Workshops |chapter=On the Development and Distribution of R Packages |date=2015-09-07|chapter-url=https://doi.org/10.1145/2797433.2797476|series=ECSAW '15|location=Dubrovnik, Cavtat, Croatia|publisher=Association for Computing Machinery|pages=1–6|doi=10.1145/2797433.2797476|isbn=978-1-4503-3393-1|s2cid=1680582|url=https://zenodo.org/record/851546 }}
  • {{cite journal |last1=Fox |first1=John |title=Aspects of the Social Organization and Trajectory of the R Project |journal=The R Journal |date=2009 |volume=1 |issue=2 |pages=5–13 |doi=10.32614/RJ-2009-014 |url=https://journal.r-project.org/archive/2009/RJ-2009-014/index.html |language=en |issn=2073-4859|doi-access=free }}
  • {{cite journal |last1=Fox |first1=John |last2=Leanage |first2=Allison |title=R and the Journal of Statistical Software |journal=Journal of Statistical Software |date=12 September 2016 |volume=73 |issue=1 |pages=1–13 |doi=10.18637/jss.v073.i02 |url=https://www.jstatsoft.org/article/view/v073i02 |language=en |issn=1548-7660|doi-access=free }}
  • {{Cite journal|last1=Plakidas|first1=Konstantinos|last2=Schall|first2=Daniel|last3=Zdun|first3=Uwe|date=2017|title=Evolution of the R software ecosystem: Metrics, relationships, and their impact on qualities|url=http://www.sciencedirect.com/science/article/pii/S0164121217301371|journal=Journal of Systems and Software|language=en|volume=132|pages=119–146|doi=10.1016/j.jss.2017.06.095|issn=0164-1212|url-access=subscription}}