Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
R (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== {{Anchor|CRAN}}Packages == {{Main|R package}} [[File:Ggplot2 PlantGrowth violin plot.svg|alt=refer to caption|thumb|[[Violin plot]] created from the R visualization package [[ggplot2]]]] [[R package]]s are collections of functions, documentation, and data that expand R.<ref name="rds_pagexvii">{{cite book | last1 = Wickham | first1 = Hadley | last2 = Cetinkaya-Rundel | first2 = Mine | last3 = Grolemund | first3 = Garrett | title = R for Data Science, Second Edition | publisher = [[O'Reilly Media|O'Reilly]] | year = 2023 | page = xvii | isbn = 978-1-492-09740-2 }}</ref> For example, packages can add reporting features (using packages like [[RStudio#Reproducible analyses with R Markdown vignettes|RMarkdown]], Quarto,<ref>{{Cite web |title=Quarto |url=https://quarto.org/ |access-date=2024-09-05 |website=Quarto |language=en}}</ref> [[knitr]], and [[Sweave]]) and the capability to implement various statistical techniques (such as [[linear]], [[generalized linear model|generalized linear]] and [[Nonlinear system|nonlinear]] modeling, classical [[Statistical hypothesis testing|statistical tests]], [[spatial analysis|spatial]] analysis, [[time-series analysis]], and [[Cluster analysis|clustering]]). Perceived easy package installation and usability have contributed to the language's adoption in [[data science]].<ref name="Chambers2020">{{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 |quote=The R language and related software play a major role in computing for data science. ... R packages provide tools for a wide range of purposes and users.}}</ref> Immediately available when starting R, base packages provide the basic and necessary syntax and commands for programming, computing, graphics production, [[Elementary arithmetic|basic arithmetic]], and statistical functionality.<ref>{{cite book|title=The Book of R: A First Course in Programming and Statistics|first1=Tilman M.|last1=Davies|isbn=9781593276515|year=2016|publisher=No Starch Press|location=San Francisco, California|chapter=Installing R and Contributed Packages|pages=739}}</ref> An example R package is the [[tidyverse]] package, which bundles several subsidiary packages to provide a [[User experience|common interface]]. It specializes in tasks related to accessing and processing "[[tidy data]]",<ref>[[Hadley Wickham|Wickham, Hadley]] (2014). "Tidy Data" ([https://vita.had.co.nz/papers/tidy-data.pdf PDF]). ''Journal of Statistical Software''. '''59''' (10). [[Doi (identifier)|doi]]:10.18637/jss.v059.i10.</ref> which are data contained in a [[Two-dimensional space|two-dimensional]] table with a single row for each [[observation]] and a single column for each variable.<ref name="rds">{{cite book |last1=Wickham |first1=Hadley |title=R for Data Science, Second Edition |last2=Cetinkaya-Rundel |first2=Mine |last3=Grolemund |first3=Garrett |publisher=[[O'Reilly Media|O'Reilly]] |year=2023 |isbn=978-1-492-09740-2}}</ref> Installing a package occurs only once. For example, to install the ''tidyverse'' package:<ref name="rds" /> <syntaxhighlight lang="rout"> > install.packages("tidyverse") </syntaxhighlight> To load the functions, data, and documentation of a package, one executes the <code>library()</code> function. To load ''tidyverse'':{{efn|This displays to [[Standard streams|standard error]] a listing of all the packages that ''tidyverse'' depends upon. It may also display warnings showing namespace conflicts, which may typically be ignored.}} <syntaxhighlight lang="rout"> > # Package name can be enclosed in quotes > library("tidyverse") > # But also the package name can be called without quotes > library(tidyverse) </syntaxhighlight> The [[R package#Comprehensive R Archive Network (CRAN)|Comprehensive R Archive Network]] (CRAN) was founded in 1997 by Kurt Hornik and [[Friedrich Leisch]] to host R's [[source code]], executable files, documentation, and user-created packages.<ref name=":10" /> Its name and scope mimic the [[Comprehensive TeX Archive Network]] (CTAN) and the [[Comprehensive Perl Archive Network]] (CPAN).<ref name=":10">{{Cite journal |last=Hornik |first=Kurt |date=2012 |title=The Comprehensive R Archive Network |url=https://onlinelibrary.wiley.com/doi/10.1002/wics.1212 |journal=WIREs Computational Statistics |language=en |volume=4 |issue=4 |pages=394β398 |doi=10.1002/wics.1212 |issn=1939-5108 |s2cid=62231320|url-access=subscription }}</ref> CRAN originally had three [[Mirror site|mirroring sites]] and twelve contributed packages.<ref>{{cite Q|Q101068595}}<!-- Announce: CRAN -->.</ref> {{As of|2024|10|16}}, it has 99 mirrors<ref name=":3">{{Cite web |title=The Status of CRAN Mirrors |url=https://cran.r-project.org/mirmon_report.html |access-date=2024-10-16 |website=cran.r-project.org}}</ref> and 21,513 contributed packages.<ref name=":9">{{Cite web |title=CRAN - Contributed Packages |url=https://cran.r-project.org/web/packages/index.html |access-date=2024-10-16 |website=cran.r-project.org}}</ref> Packages are also available on [[Repository (version control)|repositories]] like R-Forge, Omegahat, and [[GitHub]].<ref>{{Cite web |title=R-Forge: Welcome |url=https://r-forge.r-project.org/ |access-date=2024-09-05 |website=r-forge.r-project.org}}</ref><ref>{{Cite web |title=The Omega Project for Statistical Computing |url=https://www.omegahat.net/ |access-date=2024-09-05 |website=www.omegahat.net}}</ref><ref>{{Cite web |title=Build software better, together |url=https://github.com/trending/r |access-date=2024-09-05 |website=GitHub |language=en}}</ref> On the CRAN web site as a form of guidance, [https://cran.r-project.org/web/views/ Task Views] lists packages on CRAN that are relevant for tasks related to a certain topics, such as [[causal inference]], [[finance]], [[genetics]], [[high-performance computing]], [[machine learning]], [[medical imaging]], [[meta-analysis]], [[social science]]s, and [[spatial statistics]]. The [[Bioconductor]] project provides packages for [[Genomics|genomic]] data analysis, [[complementary DNA]], [[microarray]], and [[high-throughput sequencing]] methods.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)