Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/pakPublic

A fresh approach to package installation

NotificationsYou must be signed in to change notification settings

r-lib/pak

 
 

Repository files navigation

A Fresh Approach to R Package Installation

lifecycleCRAN RStudio mirror downloadsCodecov test coverageR-CMD-check

pak installs R packages from CRAN, Bioconductor, GitHub, URLs, gitrepositories, local files and directories. It is an alternative toinstall.packages() anddevtools::install_github(). pak is fast, safe andconvenient.

🚀 Short tour

Install or update packages from CRAN or Bioconductor

pak::pkg_install("tibble")
#> Loading metadata database ... done#>#> → Willinstall 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#> Installedcli 3.4.1(68ms)#> Installedfansi 1.0.3(78ms)#> Installedglue 1.6.2(95ms)#> Installedlifecycle 1.0.3(120ms)#> Installedmagrittr 2.0.3(126ms)#> Installedpkgconfig 2.0.3(125ms)#> Installedpillar 1.8.1(154ms)#> Installedrlang 1.0.6(176ms)#> Installedtibble 3.1.8(77ms)#> Installedutf8 1.2.2(44ms)#> Installedvctrs 0.5.1(35ms)#> 1 pkg + 10 deps: added 11[2.8s]

Install packages from GitHub

pak::pkg_install("tidyverse/tibble")
#>#> → Willupdate 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#> Packagingvctrs 0.5.1.9000#> Packagedvctrs 0.5.1.9000(1.5s)#> Buildingvctrs 0.5.1.9000#> Builtvctrs 0.5.1.9000(11s)#> Installedvctrs 0.5.1.9000 (github::r-lib/vctrs@48794fd)(36ms)#> Packagingtibble 3.1.8.9002#> Packagedtibble 3.1.8.9002(525ms)#> Buildingtibble 3.1.8.9002#> Builttibble 3.1.8.9002(3.1s)#> Installedtibble 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")
#>tibble3.1.8#> ├─fansi1.0.3#> ├─lifecycle1.0.3#> │ ├─cli3.4.1#> │ ├─glue1.6.2#> │ └─rlang1.0.6#> ├─magrittr2.0.3#> ├─pillar1.8.1#> │ ├─cli#> │ ├─fansi#> │ ├─glue#> │ ├─lifecycle#> │ ├─rlang#> │ ├─utf81.2.2#> │ └─vctrs0.5.1#> │   ├─cli#> │   ├─glue#> │   ├─lifecycle#> │   └─rlang#> ├─pkgconfig2.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")
#>#> → Willupdate 1 package.#> → The package (0 B) is cached.#>+cli 3.4.1 → 3.4.1 👷🏿🔧#> No downloads are needed, 1 pkg is cached#> Gotcli 3.4.1 (source) (96 B)#> Packagingcli 3.4.1#> Packagedcli 3.4.1(664ms)#> Buildingcli 3.4.1#> Builtcli 3.4.1(5s)#> Installedcli 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 atGetStarted with pak tosolve specific issues.

FAQ

Check out thelist of frequently askedquestions.

Reference

The complete reference of pakfunctions is the most completesource of information about pak.

I have a(nother) question

Don’t hesitate to ask at theRStudio Communityforum. Use thepak tag.

I would like to report a bug

Head to thepak issue tracker.

✨ Features

⚡ Fast - parallel downloads and installation, caching, etc.

🦺 Safe - dependency solver, system dependency solver, etc.

🏪 Convenient - packages from multiple sources, timetravel, etc.

See thecomplete list of awesomefeatures.

⬇️ 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:

OSCPUR version
Linuxx86_64R 3.5.0 - R-devel
Linuxaarch64R 3.5.0 - R-devel
macOS High Sierra+x86_64R 3.5.0 - R-devel
macOS Big Sur+aarch64R 4.1.0 - R-devel
Windowsx86_64R 3.5.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 havebinaries packages for.

Other platforms and nightly builds

See theinstallationpage!

📘 License

GPL-3 © RStudio

About

A fresh approach to package installation

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp