Skip to content

You don't need to read long manual pages for a simple task. This manual page collects the most common pak use cases.

Package installation

Install a package from CRAN or Bioconductor

pak::pkg_install("tibble")

Install a package 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.9001 👷🏾🔧 (GitHub: 44d905f)                               
#> + vctrs  0.4.1 → 0.4.1.9000 👷🏻‍♂️🔧 (GitHub: 5191dfc)                            
#>  No downloads are needed, 2 pkgs are cached                                    
#>  Got vctrs 0.4.1.9000 (source) (2.07 MB)                                       
#>  Got tibble 3.1.8.9001 (source) (1.34 MB)                                      
#>  Packaging vctrs 0.4.1.9000                                                    
#>  Packaged vctrs 0.4.1.9000 (1.3s)                                              
#>  Building vctrs 0.4.1.9000                                                     
#>  Built vctrs 0.4.1.9000 (9.7s)                                                 
#>  Installed vctrs 0.4.1.9000 (github::r-lib/vctrs@5191dfc) (29ms)               
#>  Packaging tibble 3.1.8.9001                                                   
#>  Packaged tibble 3.1.8.9001 (437ms)                                            
#>  Building tibble 3.1.8.9001                                                    
#>  Built tibble 3.1.8.9001 (2.5s)                                                
#>  Installed tibble 3.1.8.9001 (github::tidyverse/tibble@44d905f) (42ms)         
#>  1 pkg + 10 deps: kept 8, upd 2, dld 2 (NA B) [17.7s]                          

Install a package from a URL

pak::pkg_install("url::https://cran.r-project.org/src/contrib/Archive/tibble/tibble_3.1.7.tar.gz")

#>                                                                                 
#> → Will install 1 package.                                                       
#> → Will update 1 package.                                                        
#> → All 2 packages (38.65 kB) are cached.                                         
#> + ellipsis              0.3.2                                                   
#> + tibble   3.1.8.9001 → 3.1.7 👷🏻‍♀️🔧                                            
#>  No downloads are needed, 2 pkgs (38.65 kB) are cached                         
#>  Installed ellipsis 0.3.2  (13ms)                                              
#>  Building tibble 3.1.7                                                         
#>  Built tibble 3.1.7 (2.5s)                                                     
#>  Installed tibble 3.1.7  (24ms)                                                
#>  1 pkg + 11 deps: kept 9, upd 1, added 1 [3.4s]                                

Package updates

Update a package

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]                                        

Update all dependencies of a package

pak::pkg_install("tibble", upgrade = TRUE)

#>                                                                                 
#> → Will update 1 package.                                                        
#> → The package (495.82 kB) is cached.                                            
#> + cli 3.3.0 → 3.4.0 👷🏼🔧                                                         
#>  No downloads are needed, 1 pkg (495.82 kB) is cached                          
#>  Building cli 3.4.0                                                            
#>  Built cli 3.4.0 (4.6s)                                                        
#>  Installed cli 3.4.0  (35ms)                                                   
#>  1 pkg + 10 deps: kept 10, upd 1 [5.2s]                                        

Dependency lookup

Dependencies of a CRAN or Bioconductor package

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                                              

Dependency tree of a CRAN / Bioconductor package

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 ✨👷‍♀️🔧                                                            
#> │ ├─fansi                                                                       
#> │ ├─glue                                                                        
#> │ ├─lifecycle                                                                   
#> │ ├─rlang                                                                       
#> │ ├─utf8 1.2.2                                                                 
#> │ └─vctrs 0.4.1                                                                
#> │   ├─cli                                                                       
#> │   ├─glue                                                                      
#> │   └─rlang                                                                     
#> ├─pkgconfig 2.0.3                                                              
#> ├─rlang                                                                         
#> └─vctrs                                                                         
#>                                                                                 
#> Key:   new | 👷‍♀️ build | 🔧 compile                                            

Dependency tree of a package on GitHub

pak::pkg_deps_tree("tidyverse/tibble")

#> tidyverse/tibble 3.1.8.9001 ✨👷🏼‍♂️🔧                                             
#> ├─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 ✨👷🏼‍♂️🔧                                                           
#> │ ├─fansi                                                                       
#> │ ├─glue                                                                        
#> │ ├─lifecycle                                                                   
#> │ ├─rlang                                                                       
#> │ ├─utf8 1.2.2                                                                 
#> │ └─r-lib/vctrs 0.4.1.9000 ✨👷🏼‍♂️🔧                                              
#> │   ├─cli                                                                       
#> │   ├─glue                                                                      
#> │   └─rlang                                                                     
#> ├─pkgconfig 2.0.3                                                              
#> ├─rlang                                                                         
#> └─r-lib/vctrs                                                                   
#>                                                                                 
#> Key:   new | 👷🏼‍♂️ build | 🔧 compile                                           

Dependency tree of the package in the current directory

pak::local_deps_tree("tibble")

#> local::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 ✨👷🏻🔧                                                              
#> │ ├─fansi                                                                       
#> │ ├─glue                                                                        
#> │ ├─lifecycle                                                                   
#> │ ├─rlang                                                                       
#> │ ├─utf8 1.2.2                                                                 
#> │ └─vctrs 0.4.1                                                                
#> │   ├─cli                                                                       
#> │   ├─glue                                                                      
#> │   └─rlang                                                                     
#> ├─pkgconfig 2.0.3                                                              
#> ├─rlang                                                                         
#> └─vctrs                                                                         
#>                                                                                 
#> Key:   new | 👷🏻 build | 🔧 compile                                              

(Assuming package is in directory tibble.)

Explain a recursive dependency

pak::pkg_deps_explain("tibble", "rlang")

#> tibble -> lifecycle -> rlang                                                    
#> tibble -> pillar -> lifecycle -> rlang                                          
#> tibble -> pillar -> rlang                                                       
#> tibble -> pillar -> vctrs -> rlang                                              
#> tibble -> rlang                                                                 
#> tibble -> vctrs -> rlang                                                        

Package development

Install dependencies of local package

#>  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]                                                       

Install local package

#>                                                                                 
#> → Will update 1 package.                                                        
#> → The package (0 B) is cached.                                                  
#> + tibble 3.1.8 → 3.1.8 👷🏻‍♀️🔧                                                   
#>  No downloads are needed, 1 pkg is cached                                      
#>  Got tibble 3.1.8 (source) (96 B)                                              
#>  Packaging tibble 3.1.8                                                        
#>  Packaged tibble 3.1.8 (639ms)                                                 
#>  Building tibble 3.1.8                                                         
#>  Built tibble 3.1.8 (2.2s)                                                     
#>  Installed tibble 3.1.8 (local) (28ms)                                         
#>  1 pkg + 10 deps: kept 10, upd 1, dld 1 (NA B) [3.9s]                          

Install all dependencies of local package

#>                                                                                 
#> → Will install 86 packages.                                                     
#> → Will update 2 packages.                                                       
#> → Will download 1 CRAN package (1.33 MB), cached: 88 (96.03 MB).                
#> + askpass                1.1                                                    
#> + base64enc              0.1-3                                                  
#> + bench                  1.1.2                                                  
#> + bit                    4.0.4                                                  
#> + bit64                  4.0.5                                                  
#> + blob                   1.2.3                                                  
#> + brio                   1.1.3                                                  
#> + bslib                  0.4.0                                                  
#> + cachem                 1.0.6                                                  
#> + callr                  3.7.2                                                  
#> + clipr                  0.8.0                                                  
#> + colorspace             2.0-3                                                  
#> + covr                   3.6.1                                                  
#> + cpp11                  0.4.2                                                  
#> + crayon                 1.5.1                                                  
#> + curl                   4.3.2                                                  
#> + desc                   1.4.2    👷🏻                                            
#> + DiagrammeR             1.0.9                                                  
#> + diffobj                0.3.5                                                  
#> + digest                 0.6.29                                                 
#> + downloader             0.4                                                    
#> + dplyr                  1.0.10    ⬇ (1.33 MB)                                  
#> + evaluate               0.16                                                   
#> + farver                 2.1.1                                                  
#> + fastmap                1.1.0                                                  
#> + formattable            0.2.1                                                  
#> + fs                     1.5.2                                                  
#> + generics               0.1.3                                                  
#> + ggplot2                3.3.6                                                  
#> + gridExtra              2.3                                                    
#> + gtable                 0.3.1                                                  
#> + highr                  0.9                                                    
#> + hms                    1.1.2                                                  
#> + htmltools              0.5.3                                                  
#> + htmlwidgets            1.5.4                                                  
#> + httr                   1.4.4                                                  
#> + igraph                 1.3.4                                                  
#> + influenceR             0.1.0.1                                                
#> + isoband                0.2.5                                                  
#> + jquerylib              0.1.4                                                  
#> + jsonlite               1.8.0                                                  
#> + knitr                  1.40                                                   
#> + labeling               0.4.2                                                  
#> + lazyeval               0.2.2                                                  
#> + lubridate              1.8.0                                                  
#> + MASS         7.3-57  → 7.3-58.1                                               
#> + memoise                2.0.1                                                  
#> + mime                   0.12                                                   
#> + mockr                  0.2.0                                                  
#> + munsell                0.5.0                                                  
#> + nlme         3.1-157 → 3.1-159                                                
#> + nycflights13           1.0.2                                                  
#> + openssl                2.0.2                                                  
#> + pkgbuild               1.3.1                                                  
#> + pkgload                1.3.0                                                  
#> + praise                 1.0.0                                                  
#> + prettyunits            1.1.1                                                  
#> + processx               3.7.0                                                  
#> + profmem                0.6.0                                                  
#> + ps                     1.7.1                                                  
#> + purrr                  0.3.4                                                  
#> + R6                     2.5.1                                                  
#> + rappdirs               0.3.3                                                  
#> + RColorBrewer           1.1-3                                                  
#> + readr                  2.1.2                                                  
#> + rematch2               2.1.2                                                  
#> + rex                    1.2.1                                                  
#> + rmarkdown              2.16                                                   
#> + rprojroot              2.0.3                                                  
#> + rstudioapi             0.14                                                   
#> + sass                   0.4.2                                                  
#> + scales                 1.2.1                                                  
#> + stringi                1.7.8                                                  
#> + stringr                1.4.1                                                  
#> + sys                    3.4                                                    
#> + testthat               3.1.4                                                  
#> + tidyr                  1.2.1    👷🏿🔧                                           
#> + tidyselect             1.1.2                                                  
#> + tinytex                0.41                                                   
#> + tzdb                   0.3.0                                                  
#> + viridis                0.6.2                                                  
#> + viridisLite            0.4.1                                                  
#> + visNetwork             2.1.0                                                  
#> + vroom                  1.5.7                                                  
#> + waldo                  0.4.0                                                  
#> + withr                  2.5.0                                                  
#> + xfun                   0.32                                                   
#> + yaml                   2.3.5                                                  
#>  Getting 1 pkg (1.33 MB), 87 (96.03 MB) cached                                 
#>  Got tidyr 1.2.1 (source) (746.06 kB)                                          
#>  Got gtable 0.3.1 (aarch64-apple-darwin20) (159.19 kB)                         
#>  Got dplyr 1.0.10 (aarch64-apple-darwin20) (1.33 MB)                           
#>  Packaging tibble 3.1.8                                                        
#>  Installed DiagrammeR 1.0.9  (75ms)                                            
#>  Installed MASS 7.3-58.1  (83ms)                                               
#>  Installed R6 2.5.1  (89ms)                                                    
#>  Installed RColorBrewer 1.1-3  (95ms)                                          
#>  Installed askpass 1.1  (102ms)                                                
#>  Installed base64enc 0.1-3  (106ms)                                            
#>  Installed bench 1.1.2  (144ms)                                                
#>  Installed bit64 4.0.5  (41ms)                                                 
#>  Installed bit 4.0.4  (95ms)                                                   
#>  Installed blob 1.2.3  (125ms)                                                 
#>  Installed brio 1.1.3  (58ms)                                                  
#>  Installed cachem 1.0.6  (15ms)                                                
#>  Installed callr 3.7.2  (20ms)                                                 
#>  Installed clipr 0.8.0  (38ms)                                                 
#>  Installed bslib 0.4.0  (165ms)                                                
#>  Packaged tibble 3.1.8 (597ms)                                                 
#>  Installed colorspace 2.0-3  (67ms)                                            
#>  Installed covr 3.6.1  (53ms)                                                  
#>  Installed cpp11 0.4.2  (59ms)                                                 
#>  Installed crayon 1.5.1  (39ms)                                                
#>  Installed curl 4.3.2  (41ms)                                                  
#>  Installed diffobj 0.3.5  (61ms)                                               
#>  Installed digest 0.6.29  (39ms)                                               
#>  Installed downloader 0.4  (27ms)                                              
#>  Installed dplyr 1.0.10  (25ms)                                                
#>  Installed evaluate 0.16  (12ms)                                               
#>  Installed farver 2.1.1  (23ms)                                                
#>  Installed fastmap 1.1.0  (14ms)                                               
#>  Installed formattable 0.2.1  (35ms)                                           
#>  Installed fs 1.5.2  (20ms)                                                    
#>  Installed generics 0.1.3  (12ms)                                              
#>  Installed ggplot2 3.3.6  (35ms)                                               
#>  Installed gridExtra 2.3  (18ms)                                               
#>  Installed gtable 0.3.1  (15ms)                                                
#>  Installed highr 0.9  (14ms)                                                   
#>  Installed hms 1.1.2  (14ms)                                                   
#>  Installed htmltools 0.5.3  (15ms)                                             
#>  Installed htmlwidgets 1.5.4  (20ms)                                           
#>  Installed httr 1.4.4  (18ms)                                                  
#>  Installed igraph 1.3.4  (67ms)                                                
#>  Installed influenceR 0.1.0.1  (13ms)                                          
#>  Installed isoband 0.2.5  (37ms)                                               
#>  Installed jquerylib 0.1.4  (18ms)                                             
#>  Installed jsonlite 1.8.0  (40ms)                                              
#>  Installed knitr 1.40  (46ms)                                                  
#>  Installed labeling 0.4.2  (11ms)                                              
#>  Installed lazyeval 0.2.2  (14ms)                                              
#>  Installed lubridate 1.8.0  (26ms)                                             
#>  Installed memoise 2.0.1  (11ms)                                               
#>  Installed mime 0.12  (12ms)                                                   
#>  Installed mockr 0.2.0  (29ms)                                                 
#>  Installed munsell 0.5.0  (14ms)                                               
#>  Installed nlme 3.1-159  (27ms)                                                
#>  Installed nycflights13 1.0.2  (18ms)                                          
#>  Installed openssl 2.0.2  (33ms)                                               
#>  Installed pkgbuild 1.3.1  (11ms)                                              
#>  Installed pkgload 1.3.0  (12ms)                                               
#>  Installed praise 1.0.0  (30ms)                                                
#>  Installed prettyunits 1.1.1  (11ms)                                           
#>  Installed processx 3.7.0  (16ms)                                              
#>  Installed profmem 0.6.0  (12ms)                                               
#>  Installed ps 1.7.1  (14ms)                                                    
#>  Installed purrr 0.3.4  (17ms)                                                 
#>  Installed rappdirs 0.3.3  (13ms)                                              
#>  Installed readr 2.1.2  (31ms)                                                 
#>  Installed rematch2 2.1.2  (10ms)                                              
#>  Installed rex 1.2.1  (13ms)                                                   
#>  Installed rmarkdown 2.16  (65ms)                                              
#>  Installed rprojroot 2.0.3  (13ms)                                             
#>  Building desc 1.4.2                                                           
#>  Installed rstudioapi 0.14  (17ms)                                             
#>  Installed sass 0.4.2  (36ms)                                                  
#>  Installed scales 1.2.1  (89ms)                                                
#>  Installed stringr 1.4.1  (35ms)                                               
#>  Installed sys 3.4  (12ms)                                                     
#>  Installed testthat 3.1.4  (40ms)                                              
#>  Installed stringi 1.7.8  (230ms)                                              
#>  Installed tidyselect 1.1.2  (39ms)                                            
#>  Installed tinytex 0.41  (30ms)                                                
#>  Building tidyr 1.2.1                                                          
#>  Installed tzdb 0.3.0  (138ms)                                                 
#>  Installed viridisLite 0.4.1  (41ms)                                           
#>  Installed viridis 0.6.2  (42ms)                                               
#>  Installed waldo 0.4.0  (28ms)                                                 
#>  Installed visNetwork 2.1.0  (98ms)                                            
#>  Installed vroom 1.5.7  (89ms)                                                 
#>  Installed withr 2.5.0  (82ms)                                                 
#>  Installed xfun 0.32  (115ms)                                                  
#>  Installed yaml 2.3.5  (51ms)                                                  
#>  Built desc 1.4.2 (1.5s)                                                       
#>  Installed desc 1.4.2  (15ms)                                                  
#>  Built tidyr 1.2.1 (4.4s)                                                      
#>  Installed tidyr 1.2.1  (19ms)                                                 
#>  103 deps: kept 15, upd 2, added 86, dld 3 (2.23 MB) [10.4s]                   

Repositories

List current repositories

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                 

Add custom repository

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                 

Remove custom repositories

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.

Time travel using RSPM

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                 

Time travel using MRAN

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                 

Caches

Inspect metadata cache

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                          

Update metadata cache

#>  Updated metadata database: 27.10 kB in 4 files.                               
#>  R 4.2 aarch64-apple-darwin20 packages are missing from Bioconductor           
#>  Updating metadata database ... done                                           

Clean metadata cache

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                                                                           
#>                                                                                 

Inspect package cache

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                                      

View a package cache summary

#> $cachepath                                                                      
#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/pkg"          
#>                                                                                 
#> $files                                                                          
#> [1] 1873                                                                        
#>                                                                                 
#> $size                                                                           
#> [1] 6711771702                                                                  
#>                                                                                 

Clean package cache

Libraries

List packages in a library

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.