pak
A Fresh Approach to R Package Installation
pak installs R packages from CRAN, Bioconductor, GitHub, URLs, git
repositories, local files and directories. It is an alternative to
install.packages()
and devtools::install_github()
. pak is fast, safe and
convenient.
π Short tourπ Quick links (start here if in doubt!)β¨ Featuresβ¬οΈ Installationπ License
π Short tour
Install or update packages from CRAN or Bioconductor
pak::pkg_install("tibble")
#> β Loading metadata database ... done #> #> β Will install 11 packages. #> β All 11 packages (7.48 MB) are cached. #> + cli 3.4.1 #> + fansi 1.0.3 #> + glue 1.6.2 #> + lifecycle 1.0.3 #> + magrittr 2.0.3 #> + pillar 1.8.1 #> + pkgconfig 2.0.3 #> + rlang 1.0.6 #> + tibble 3.1.8 #> + utf8 1.2.2 #> + vctrs 0.5.1 #> βΉ No downloads are needed, 11 pkgs (7.48 MB) are cached #> β Installed cli 3.4.1 (68ms) #> β Installed fansi 1.0.3 (78ms) #> β Installed glue 1.6.2 (95ms) #> β Installed lifecycle 1.0.3 (120ms) #> β Installed magrittr 2.0.3 (126ms) #> β Installed pkgconfig 2.0.3 (125ms) #> β Installed pillar 1.8.1 (154ms) #> β Installed rlang 1.0.6 (176ms) #> β Installed tibble 3.1.8 (77ms) #> β Installed utf8 1.2.2 (44ms) #> β Installed vctrs 0.5.1 (35ms) #> β 1 pkg + 10 deps: added 11 [2.8s]
Install packages from GitHub
pak::pkg_install("tidyverse/tibble")
#> #> β Will update 2 packages. #> β All 2 packages (0 B) are cached. #> + tibble 3.1.8 β 3.1.8.9002 π·πΎπ§ (GitHub: 37ec86a) #> + vctrs 0.5.1 β 0.5.1.9000 π·πΌββοΈπ§ (GitHub: 48794fd) #> βΉ No downloads are needed, 2 pkgs are cached #> βΉ Packaging vctrs 0.5.1.9000 #> β Packaged vctrs 0.5.1.9000 (1.5s) #> βΉ Building vctrs 0.5.1.9000 #> β Built vctrs 0.5.1.9000 (11s) #> β Installed vctrs 0.5.1.9000 (github::r-lib/vctrs@48794fd) (36ms) #> βΉ Packaging tibble 3.1.8.9002 #> β Packaged tibble 3.1.8.9002 (525ms) #> βΉ Building tibble 3.1.8.9002 #> β Built tibble 3.1.8.9002 (3.1s) #> β Installed tibble 3.1.8.9002 (github::tidyverse/tibble@37ec86a) (34ms) #> β 1 pkg + 10 deps: kept 9, upd 2 [18.9s]
Look up dependencies
pak::pkg_deps_tree("tibble")
#> tibble 3.1.8 β¨ #> ββfansi 1.0.3 β¨ #> ββlifecycle 1.0.3 β¨ #> β ββcli 3.4.1 β¨ #> β ββglue 1.6.2 β¨ #> β ββrlang 1.0.6 β¨ #> ββmagrittr 2.0.3 β¨ #> ββpillar 1.8.1 β¨ #> β ββcli #> β ββfansi #> β ββglue #> β ββlifecycle #> β ββrlang #> β ββutf8 1.2.2 β¨ #> β ββvctrs 0.5.1 β¨ #> β ββcli #> β ββglue #> β ββlifecycle #> β ββrlang #> ββpkgconfig 2.0.3 β¨ #> ββrlang #> ββvctrs #> #> Key: β¨ new
Explain dependencies
pak::pkg_deps_explain("tibble", "rlang")
#> tibble -> lifecycle -> rlang #> tibble -> pillar -> lifecycle -> rlang #> tibble -> pillar -> rlang #> tibble -> pillar -> vctrs -> lifecycle -> rlang #> tibble -> pillar -> vctrs -> rlang #> tibble -> rlang #> tibble -> vctrs -> lifecycle -> rlang #> tibble -> vctrs -> rlang
Install a local package and its dependencies
pak::local_install("cli")
#> #> β Will update 1 package. #> β The package (0 B) is cached. #> + cli 3.4.1 β 3.4.1 π·πΏπ§ #> βΉ No downloads are needed, 1 pkg is cached #> β Got cli 3.4.1 (source) (96 B) #> βΉ Packaging cli 3.4.1 #> β Packaged cli 3.4.1 (664ms) #> βΉ Building cli 3.4.1 #> β Built cli 3.4.1 (5s) #> β Installed cli 3.4.1 (local) (42ms) #> β 1 pkg: upd 1, dld 1 (NA B) [6.4s]
π Quick links (start here if in doubt!)
How do I β¦ ?
Start with at Get Started with pak to solve specific issues.
FAQ
Check out list of frequently asked questions.
Reference
The complete reference of pak functions is the most complete source of information about pak.
I have a(nother) question
Donβt hesitate to ask at the RStudio Community
forum. Use the pak
tag.
I would like to report a bug
Head to the pak issue tracker.
β¨ Features
See the complete list of awesome features.
β¬οΈ Installation
Pre-built binaries
Install a binary build of pak from our repository on GitHub:
install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))
This is supported for the following systems:
OS | CPU | R version |
---|---|---|
Linux | x86_64 | R 3.4.0 - R-devel |
Linux | aarch64 | R 3.4.0 - R-devel |
macOS High Sierra+ | x86_64 | R 3.4.0 - R-devel |
macOS Big Sur+ | aarch64 | R 4.1.0 - R-devel |
Windows | x86_64 | R 3.4.0 - R-devel |
For macOS we only support the official CRAN R build. Other builds, e.g. Homebrew R, are not supported.
Install from CRAN
Install the released version of the package from CRAN as usual:
install.packages("pak")
This potentially needs a C compiler on platforms CRAN does not have binaries packages for.
Other platforms and nightly builds
See the installation page!
π License
GPL-3 Β© RStudio