You don't need to read long manual pages for a simple task. This manual page collects the most common pak use cases.
pak::pkg_install("tibble")
pak::pkg_install("tidyverse/tibble")
#> #> → Will update 2 packages. #> → All 2 packages (0 B) are cached. #> + tibble 3.1.8 → 3.1.8.9001
pak::pkg_install("tibble")
#> #> → Will update 1 package. #> → The package (724.32 kB) is cached. #> + tibble 3.1.7 → 3.1.8 #> ℹ No downloads are needed, 1 pkg (724.32 kB) is cached #> ✔ Installed tibble 3.1.8 (29ms) #> ✔ 1 pkg + 10 deps: kept 9, upd 1 [572ms]
pak::pkg_install("tibble", upgrade = TRUE)
#> #> → Will update 1 package. #> → The package (495.82 kB) is cached. #> + cli 3.3.0 → 3.4.0
pak::pkg_deps("tibble")
#> # A data frame: 11 × 32 #> ref type direct direc…¹ status package version license needs…² prior…³ #> <chr> <chr> <lgl> <lgl> <chr> <chr> <chr> <chr> <lgl> <chr> #> 1 fansi stan… FALSE FALSE OK fansi 1.0.3 GPL-2 … FALSE NA #> 2 glue stan… FALSE FALSE OK glue 1.6.2 MIT + … FALSE NA #> 3 lifecycle stan… FALSE FALSE OK lifecy… 1.0.1 MIT + … FALSE NA #> 4 magrittr stan… FALSE FALSE OK magrit… 2.0.3 MIT + … FALSE NA #> 5 pillar stan… FALSE FALSE OK pillar 1.8.1 MIT + … FALSE NA #> 6 pkgconfig stan… FALSE FALSE OK pkgcon… 2.0.3 MIT + … FALSE NA #> 7 rlang stan… FALSE FALSE OK rlang 1.0.5 MIT + … FALSE NA #> 8 tibble stan… TRUE TRUE OK tibble 3.1.8 MIT + … FALSE NA #> 9 utf8 stan… FALSE FALSE OK utf8 1.2.2 Apache… FALSE NA #> 10 vctrs stan… FALSE FALSE OK vctrs 0.4.1 MIT + … FALSE NA #> 11 cli stan… FALSE FALSE OK cli 3.4.0 MIT + … TRUE NA #> # … with 22 more variables: md5sum <chr>, sha256 <chr>, filesize <int>, #> # built <chr>, platform <chr>, rversion <chr>, repotype <chr>, repodir <chr>, #> # target <chr>, deps <list>, mirror <chr>, sources <list>, remote <list>, #> # error <list>, metadata <list>, dep_types <list>, params <list>, #> # sysreqs <chr>, cache_status <chr>, lib_status <chr>, old_version <chr>, #> # new_version <chr>, and abbreviated variable names ¹directpkg, #> # ²needscompilation, ³priority
pak::pkg_deps_tree("tibble")
#> tibble 3.1.8 ✨ #> ├─fansi 1.0.3 ✨ #> ├─lifecycle 1.0.1 ✨ #> │ ├─glue 1.6.2 ✨ #> │ └─rlang 1.0.5 ✨ #> ├─magrittr 2.0.3 ✨ #> ├─pillar 1.8.1 ✨ #> │ ├─cli 3.4.0 ✨
pak::local_install_deps()
#> ✔ Updated metadata database: 1.42 MB in 5 files. #> ℹ R 4.2 aarch64-apple-darwin20 packages are missing from Bioconductor #> ✔ Updating metadata database ... done #> #> → The package (0 B) is cached. #> ℹ No downloads are needed #> ✔ 10 deps: kept 10 [7.4s]
pak::local_install()
#> #> → Will update 1 package. #> → The package (0 B) is cached. #> + tibble 3.1.8 → 3.1.8
pak::repo_get()
#> # A data frame: 5 × 5 #> name url type r_ver…¹ bioc_…² #> * <chr> <chr> <chr> <chr> <chr> #> 1 CRAN https://cloud.r-project.org cran * NA #> 2 BioCsoft https://bioconductor.org/packages/3.15/bi… bioc 4.2.1 3.15 #> 3 BioCann https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 4 BioCexp https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 5 BioCworkflows https://bioconductor.org/packages/3.15/wo… bioc 4.2.1 3.15 #> # … with abbreviated variable names ¹r_version, ²bioc_version
pak::repo_add(rhub = 'https://r-hub.r-universe.dev')
pak::repo_get()
#> # A data frame: 6 × 5 #> name url type r_ver…¹ bioc_…² #> * <chr> <chr> <chr> <chr> <chr> #> 1 CRAN https://cloud.r-project.org cran * NA #> 2 rhub https://r-hub.r-universe.dev cran… * NA #> 3 BioCsoft https://bioconductor.org/packages/3.15/bi… bioc 4.2.1 3.15 #> 4 BioCann https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 5 BioCexp https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 6 BioCworkflows https://bioconductor.org/packages/3.15/wo… bioc 4.2.1 3.15 #> # … with abbreviated variable names ¹r_version, ²bioc_version
options(repos = getOption("repos")["CRAN"])
pak::repo_get()
#> # A data frame: 5 × 5 #> name url type r_ver…¹ bioc_…² #> * <chr> <chr> <chr> <chr> <chr> #> 1 CRAN https://cloud.r-project.org cran * NA #> 2 BioCsoft https://bioconductor.org/packages/3.15/bi… bioc 4.2.1 3.15 #> 3 BioCann https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 4 BioCexp https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 5 BioCworkflows https://bioconductor.org/packages/3.15/wo… bioc 4.2.1 3.15 #> # … with abbreviated variable names ¹r_version, ²bioc_version
Keeps only CRAN and (by default) Bioconductor.
pak::repo_add(CRAN = "RSPM@2022-06-30")
pak::repo_get()
#> # A data frame: 5 × 5 #> name url type r_ver…¹ bioc_…² #> * <chr> <chr> <chr> <chr> <chr> #> 1 CRAN https://packagemanager.rstudio.com/all/11… cran * NA #> 2 BioCsoft https://bioconductor.org/packages/3.15/bi… bioc 4.2.1 3.15 #> 3 BioCann https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 4 BioCexp https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 5 BioCworkflows https://bioconductor.org/packages/3.15/wo… bioc 4.2.1 3.15 #> # … with abbreviated variable names ¹r_version, ²bioc_version
pak::repo_add(CRAN = "MRAN@2022-06-30")
pak::repo_get()
#> # A data frame: 5 × 5 #> name url type r_ver…¹ bioc_…² #> * <chr> <chr> <chr> <chr> <chr> #> 1 CRAN https://cran.microsoft.com/snapshot/2022-… cran * NA #> 2 BioCsoft https://bioconductor.org/packages/3.15/bi… bioc 4.2.1 3.15 #> 3 BioCann https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 4 BioCexp https://bioconductor.org/packages/3.15/da… bioc 4.2.1 3.15 #> 5 BioCworkflows https://bioconductor.org/packages/3.15/wo… bioc 4.2.1 3.15 #> # … with abbreviated variable names ¹r_version, ²bioc_version
pak::meta_list()
#> ✔ Updated metadata database: 4.51 MB in 8 files. #> ℹ R 4.2 aarch64-apple-darwin20 packages are missing from Bioconductor #> ✔ Updating metadata database ... done #> # A data frame: 41,614 × 32 #> package version depends sugge…¹ license imports linki…² archs enhan…³ os_type #> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 A3 1.0.0 R (>= … random… GPL (>… NA NA NA NA NA #> 2 AATtoo… 0.0.1 R (>= … NA GPL-3 magrit… NA NA NA NA #> 3 ABACUS 1.0.0 R (>= … rmarkd… GPL-3 ggplot… NA NA NA NA #> 4 ABC.RAP 0.9.0 R (>= … knitr,… GPL-3 graphi… NA NA NA NA #> 5 ABCana… 1.2.1 R (>= … NA GPL-3 plotrix NA NA NA NA #> 6 ABCopt… 0.15.0 NA testth… MIT + … Rcpp, … Rcpp ABCo… NA NA #> 7 ABCp2 1.2 MASS NA GPL-2 NA NA NA NA NA #> 8 ABHgen… 1.0.1 NA knitr,… GPL-3 ggplot… NA NA NA NA #> 9 ABPS 0.3 NA testth… GPL (>… kernlab NA NA NA NA #> 10 ACA 1.1 R (>= … NA GPL graphi… NA NA NA NA #> # … with 41,604 more rows, 22 more variables: priority <chr>, #> # license_is_foss <chr>, license_restricts_use <chr>, repodir <chr>, #> # rversion <chr>, platform <chr>, needscompilation <chr>, ref <chr>, #> # type <chr>, direct <lgl>, status <chr>, target <chr>, mirror <chr>, #> # sources <list>, filesize <int>, sha256 <chr>, sysreqs <chr>, built <chr>, #> # published <dttm>, deps <list>, md5sum <chr>, path <chr>, and abbreviated #> # variable names ¹suggests, ²linkingto, ³enhances
pak::meta_update()
#> ✔ Updated metadata database: 27.10 kB in 4 files. #> ℹ R 4.2 aarch64-apple-darwin20 packages are missing from Bioconductor #> ✔ Updating metadata database ... done
pak::meta_clean(force = TRUE)
pak::meta_summary()
#> $cachepath #> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata" #> #> $current_db #> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/pkgs #> -9e6361fdc9.rds" #> #> $raw_files #> character(0) #> #> $db_files #> character(0) #> #> $size #> [1] 0 #>
pak::cache_list()
#> # A data frame: 1,873 × 11 #> fullpath path package url etag sha256 version platf…¹ built vigne…² #> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 /Users/gaborc… src/… pak file… NA 4e451… 0.2.0.… source NA NA #> 2 /Users/gaborc… src/… pak NA NA NA 0.2.0.… aarch6… TRUE FALSE #> 3 /Users/gaborc… bin/… cli http… "\"1… cbf6f… 3.1.1 aarch6… NA NA #> 4 /Users/gaborc… src/… R7 NA NA 76af5… NA NA FALSE NA #> 5 /Users/gaborc… src/… Annota… http… "\"4… 9c18b… 1.18.0 source NA NA #> 6 /Users/gaborc… bin/… GGally http… "\"1… a8ab8… 2.1.2 aarch6… NA NA #> 7 /Users/gaborc… src/… ensemb… http… "\"3… 0913f… 2.18.3 source NA NA #> 8 /Users/gaborc… src/… bioviz… http… "\"2… 5faa6… 1.42.0 source NA NA #> 9 /Users/gaborc… src/… Annota… http… "\"4… 283e2… 1.56.2 source NA NA #> 10 /Users/gaborc… src/… rtrack… http… "\"3… 0c5e4… 1.54.0 source NA NA #> # … with 1,863 more rows, 1 more variable: rversion <chr>, and abbreviated #> # variable names ¹platform, ²vignettes
pak::cache_summary()
#> $cachepath #> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/pkg" #> #> $files #> [1] 1873 #> #> $size #> [1] 6711771702 #>
pak::cache_clean()
pak::lib_status(Sys.getenv("R_LIBS_USER"))
#> # A data frame: 531 × 38 #> library package title version depends repos…¹ license needs…² built remot…³ #> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <lgl> <chr> <chr> #> 1 /Users/g… abc Tool… 2.2.1 R (>= … CRAN GPL (>… FALSE R 4.… standa… #> 2 /Users/g… abc.da… Data… 1.0 R (>= … CRAN GPL (>… FALSE R 4.… standa… #> 3 /Users/g… abind Comb… 1.4-5 R (>= … CRAN LGPL (… FALSE R 4.… standa… #> 4 /Users/g… ape Anal… 5.6-2 R (>= … CRAN GPL-2 … TRUE R 4.… standa… #> 5 /Users/g… archive Mult… 1.1.5 R (>= … CRAN MIT + … TRUE R 4.… standa… #> 6 /Users/g… arrow Inte… 8.0.0 R (>= … CRAN Apache… TRUE R 4.… standa… #> 7 /Users/g… asciic… Crea… 2.1.0.… NA NA MIT + … NA R 4.… NA #> 8 /Users/g… askpass Safe… 1.1 NA CRAN MIT + … TRUE R 4.… standa… #> 9 /Users/g… assert… Easy… 0.2.1 NA CRAN GPL-3 FALSE R 4.… standa… #> 10 /Users/g… async Asyn… 0.0.0.… R (>= … NA MIT + … NA R 4.… NA #> # … with 521 more rows, 28 more variables: remotepkgref <chr>, remoteref <chr>, #> # remoterepos <chr>, remotepkgplatform <chr>, remotesha <chr>, imports <chr>, #> # suggests <chr>, linkingto <chr>, remotes <chr>, enhances <chr>, #> # biocviews <chr>, remoteurl <chr>, priority <chr>, remotehost <chr>, #> # remoterepo <chr>, remoteusername <chr>, remoteetag <chr>, #> # remotepackaged <chr>, md5sum <chr>, platform <chr>, sysreqs <chr>, #> # ref <chr>, type <chr>, status <chr>, rversion <chr>, sources <list>, …
Pass the directory of the library as the argument.