CRAN (R)
CRAN (the Comprehensive R Archive Network) is the official repository for R packages and the R software itself. install.packages() downloads from CRAN by default.
R
CRAN is a network of mirror servers hosting the R language distribution and over 20,000 contributed packages. When you run install.packages("name"), R fetches the package from a CRAN mirror, along with its dependencies. CRAN is to R what PyPI is to Python or npm is to Node.
Packages submitted to CRAN must pass strict automated checks (R CMD check) across platforms, which gives a baseline of quality and portability — a CRAN package is expected to install and run cleanly on Windows, macOS, and Linux. Each package has a CRAN page with its documentation, manual (PDF), and version history.
CRAN isn't the only source: Bioconductor specializes in genomics packages, and GitHub hosts cutting-edge or unreleased versions you install with remotes::install_github(). But for stable, vetted packages, CRAN is the default and most trusted source.
Syntax
install.packages("dplyr") # from CRAN
install.packages("x", repos = "...")Examples
R — install.packages defaults to a CRAN mirror.
# Install a package from CRAN (run once)
install.packages("ggplot2")
# Then load and use it
library(ggplot2)