diff --git a/.gitignore b/.gitignore index 830140781..024b4faff 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ /man/macros/eval2.Rd /man/chunks/sysreqs.html /man/chunks/sysreqs_cache +TEST.R +.vscode diff --git a/NAMESPACE b/NAMESPACE index f904762ba..b72675f3c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -43,6 +43,7 @@ export(pkg_download) export(pkg_history) export(pkg_install) export(pkg_list) +export(pkg_load) export(pkg_name_check) export(pkg_remove) export(pkg_search) diff --git a/R/package.R b/R/package.R index a13a3bcf5..32e8ec399 100644 --- a/R/package.R +++ b/R/package.R @@ -1,3 +1,97 @@ +#' Load packages +#' +#' Load packages, if missing try to install one or more packages and their +#' dependencies into a single package library. +#' +#' @param pkg Package names or package references. E.g. +#' - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository +#' in general, +#' - `tidyverse/ggplot2`: package from GitHub, +#' - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, +#' - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, +#' - `.`: package in the current working directory. +#' +#' @param install Whether to install missing packages. If TRUE, missing packages +#' will be installed with pkg_install(). If FALSE, only try to load the #' +#' packages +#' +#' See "[Package sources]" for more details. +#' @param lib Package library to install the packages to. Note that _all_ +#' dependent packages will be installed here, even if they are +#' already installed in another library. The only exceptions are base +#' and recommended packages installed in `.Library`. These are not +#' duplicated in `lib`, unless a newer version of a recommemded package +#' is needed. +#' @param upgrade When `FALSE`, the default, pak does the minimum amount +#' of work to give you the latest version(s) of `pkg`. It will only upgrade +#' dependent packages if `pkg`, or one of their dependencies explicitly +#' require a higher version than what you currently have. It will also +#' prefer a binary package over to source package, even it the binary +#' package is older. +#' +#' When `upgrade = TRUE`, pak will ensure that you have the latest +#' version(s) of `pkg` and all their dependencies. +#' @param ask Whether to ask for confirmation when installing a different +#' version of a package that is already installed. Installations that only +#' add new packages never require confirmation. +#' @param dependencies What kinds of dependencies to install. Most commonly +#' one of the following values: +#' - `NA`: only required (hard) dependencies, +#' - `TRUE`: required dependencies plus optional and development +#' dependencies, +#' - `FALSE`: do not install any dependencies. (You might end up with a +#' non-working package, and/or the installation might fail.) +#' See [Package dependency types] for other possible values and more +#' information about package dependencies. +#' @return (Invisibly) A data frame with information about the installed +#' package(s). +#' +#' @export +#' @seealso [Get started with pak], [Package sources], [FAQ], +#' [The dependency solver]. +#' @family package functions +#' @section Examples: +#' ```{asciicast pkg-install-dplyr} +#' pkg_load("dplyr") +#' ``` +#' +#' Upgrade dplyr and all its dependencies: +#' ```{asciicast pkg-install-upgrade} +#' pkg_load("dplyr", upgrade = TRUE) +#' ```` +#' +#' Install the development version of dplyr: +#' ```{asciicast pkg-install-gh} +#' pkg_load("tidyverse/dplyr") +#' ``` +#' +#' Switch back to the CRAN version. This will be fast because +#' pak will have cached the prior install. +#' ```{asciicast pkg-install-cran} +#' pkg_load("dplyr") +#' ``` + +pkg_load <- function(pkg, install = TRUE, lib = .libPaths()[[1L]], upgrade = FALSE, ask = interactive(), dependencies = NA) { + # Try to load packages + is_installed <- sapply(pkg, function(x) { + return(suppressMessages( + suppressWarnings(require(x, character.only = TRUE)) + )) + }) + # Give feedback to user + if (all(is_installed)) { + cli::cli_alert_success("All packages are loaded.") + } else { + cli::cli_alert_warning("{sum(!is_installed)} out of {length(is_installed)} packages are not currently installed.") + } + # Install missing packages if requested + if (install && length(pkg[!is_installed]) > 0) { + cli::cli_alert_info("Installing {sum(!is_installed)} missing package(s).") + pak::pkg_install(pkg[!is_installed]) + } else { + cli::cli_alert_info("Do not install missing packages.") + } +} #' Install packages #' @@ -70,20 +164,23 @@ pkg_install <- function(pkg, lib = .libPaths()[[1L]], upgrade = FALSE, ask = interactive(), dependencies = NA) { - start <- Sys.time() status <- remote( function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), - list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask, - start = start, dependencies = dependencies, - loaded = loaded_packages(lib))) + list( + pkg = pkg, lib = lib, upgrade = upgrade, ask = ask, + start = start, dependencies = dependencies, + loaded = loaded_packages(lib) + ) + ) unloaded <- handle_status(status, lib, ask)$unloaded inst <- remote( function(...) get("pkg_install_do_plan", asNamespace("pak"))(...), - list(proposal = NULL)) + list(proposal = NULL) + ) if (length(unloaded) > 0) offer_restart(unloaded) @@ -106,9 +203,8 @@ pkg_install_make_plan <- function(pkg, lib, upgrade, ask, start, } pkg_install_do_plan <- function(proposal) { - proposal <- proposal %||% pkg_data$tmp$proposal - start <- pkg_data$tmp$start + start <- pkg_data$tmp$start pkg_data$tmp <- NULL # Actually download packages as needed @@ -154,7 +250,8 @@ pkg_status <- function(pkg, lib = .libPaths()) { load_extra("pillar") remote( function(...) asNamespace("pak")$pkg_status_internal(...), - list(pkg = pkg, lib = lib)) + list(pkg = pkg, lib = lib) + ) } pkg_status_internal <- function(pkg, lib = .libPaths()) { diff --git a/_pkgdown.yml b/_pkgdown.yml index b8a60d379..d25a31ebd 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -44,6 +44,7 @@ reference: - pak - pkg_status - pkg_remove + - pkg_load - subtitle: Dependencies contents: - pkg_deps diff --git a/man/cache.Rd b/man/cache.Rd index 19a17499e..e6a48ce16 100644 --- a/man/cache.Rd +++ b/man/cache.Rd @@ -16,125 +16,66 @@ cache_delete(...) cache_clean() } \arguments{ -\item{...}{For \code{cache_list()} and \code{cache_delete()}, \code{...} may contain -filters, where the argument name is the column name. E.g. \code{package}, -\code{version}, etc. Call \code{cache_list()} without arguments to see the -available column names. If you call \code{cache_delete()} without arguments, +\item{...}{For `cache_list()` and `cache_delete()`, `...` may contain +filters, where the argument name is the column name. E.g. `package`, +`version`, etc. Call `cache_list()` without arguments to see the +available column names. If you call `cache_delete()` without arguments, it will delete all cached files.} } \value{ -\code{cache_summary()} returns a list with elements: -\itemize{ -\item \code{cachepath}: absolute path to the package cache -\item \code{files}: number of files (packages) in the cache -\item \code{size}: total size of package cache in bytes -} +`cache_summary()` returns a list with elements: +* `cachepath`: absolute path to the package cache +* `files`: number of files (packages) in the cache +* `size`: total size of package cache in bytes -\code{cache_list()} returns a data frame with the data about the cache. +`cache_list()` returns a data frame with the data about the cache. -\code{cache_delete()} returns nothing. +`cache_delete()` returns nothing. -\code{cache_clean()} returns nothing. +`cache_clean()` returns nothing. } \description{ Various utilities to inspect and clean the package cache. See the pkgcache package if you need for control over the package cache. } \details{ -\code{cache_summary()} returns a summary of the package cache. +`cache_summary()` returns a summary of the package cache. -\code{cache_list()} lists all (by default), or a subset of +`cache_list()` lists all (by default), or a subset of packages in the package cache. -\code{cache_delete()} deletes files from the cache. +`cache_delete()` deletes files from the cache. -\code{cache_clean()} deletes all files from the cache. +`cache_clean()` deletes all files from the cache. } \section{Examples}{ +```{asciicast cache-summary} +cache_summary() +``` -\if{html}{\out{
}}\preformatted{cache_summary() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> $cachepath                                                              
-#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/pkg"  
-#>                                                                         
-#> $files                                                                  
-#> [1] 483                                                                 
-#>                                                                         
-#> $size                                                                   
-#> [1] 654662486                                                           
-#>                                                                         
-
-}} - - - -\if{html}{\out{
}}\preformatted{cache_list() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 483 × 11                                                
-#>    fullpath       path  package url   etag  sha256 version platf…¹ built
-#>    <chr>          <chr> <chr>   <chr> <chr> <chr>  <chr>   <chr>   <int>
-#>  1 /Users/gaborc… arch… NA      http… "\\"1… 0c8f0… NA      NA         NA
-#>  2 /Users/gaborc… bin/… evalua… http… "\\"1… 08a39… 0.17    aarch6…    NA
-#>  3 /Users/gaborc… bin/… crayon  http… "\\"2… 1e6d5… 1.5.2   aarch6…    NA
-#>  4 /Users/gaborc… bin/… common… http… "\\"4… 47b4a… 1.8.1   aarch6…    NA
-#>  5 /Users/gaborc… bin/… curl    http… "\\"b… 7b8ba… 4.3.3   aarch6…    NA
-#>  6 /Users/gaborc… bin/… tinytex http… "\\"2… 7e9ba… 0.42    aarch6…    NA
-#>  7 /Users/gaborc… bin/… jsonli… http… "\\"1… 68e59… 1.8.2   aarch6…    NA
-#>  8 /Users/gaborc… bin/… lifecy… http… "\\"1… 7ce27… 1.0.3   aarch6…    NA
-#>  9 /Users/gaborc… bin/… vctrs   http… "\\"1… c3a69… 0.4.2   aarch6…    NA
-#> 10 /Users/gaborc… src/… pkgcac… NA     NA   9b70a… NA      NA          0
-#> # … with 473 more rows, 2 more variables: vignettes <int>,              
-#> #   rversion <chr>, and abbreviated variable name ¹​platform            
-
-}} - - -\if{html}{\out{
}}\preformatted{cache_list(package = "recipes") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 1 × 11                                                  
-#>   fullp…¹ path  package url   etag  sha256 version platf…² built vigne…³
-#>   <chr>   <chr> <chr>   <chr> <chr> <chr>  <chr>   <chr>   <int>   <int>
-#> 1 /Users… bin/… recipes http… "\\"1… e281e… 1.0.2   aarch6…    NA      NA
-#> # … with 1 more variable: rversion <chr>, and abbreviated variable      
-#> #   names ¹​fullpath, ²​platform, ³​vignettes                           
-
-}} - - -\if{html}{\out{
}}\preformatted{cache_list(platform = "source") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 69 × 11                                                 
-#>    fullpath       path  package url   etag  sha256 version platf…¹ built
-#>    <chr>          <chr> <chr>   <chr> <chr> <chr>  <chr>   <chr>   <int>
-#>  1 /Users/gaborc… src/… crayon  http… "\\"9… 70a9a… 1.5.2   source     NA
-#>  2 /Users/gaborc… src/… zip     http… "\\"1… 14873… 2.2.1   source     NA
-#>  3 /Users/gaborc… src/… curl    http… "\\"a… 3567b… 4.3.3   source     NA
-#>  4 /Users/gaborc… src/… rlang   http… "\\"b… e6973… 1.0.6   source     NA
-#>  5 /Users/gaborc… src/… openssl http… "\\"1… 7cde9… 2.0.3   source     NA
-#>  6 /Users/gaborc… src/… tinytex http… "\\"8… 205f7… 0.42    source     NA
-#>  7 /Users/gaborc… src/… evalua… http… "\\"6… 49c74… 0.17    source     NA
-#>  8 /Users/gaborc… src/… Rcpp    http… "\\"2… 807ce… 1.0.9   source     NA
-#>  9 /Users/gaborc… src/… knitr   http… "\\"d… 9b8f9… 1.40    source     NA
-#> 10 /Users/gaborc… src/… lpSolve http… "\\"7… f7258… 5.6.17  source     NA
-#> # … with 59 more rows, 2 more variables: vignettes <int>,               
-#> #   rversion <chr>, and abbreviated variable name ¹​platform            
-
-}} - - - -\if{html}{\out{
}}\preformatted{cache_delete(package = "knitr") -cache_delete(platform = "macos") -}\if{html}{\out{
}} +```{asciicast cache-list} +cache_list() +``` + +```{asciicast cache-list-2} +cache_list(package = "recipes") +``` + +```{asciicast cache-list-3} +cache_list(platform = "source") +``` -\if{html}{\out{
}}\preformatted{cache_clean() -}\if{html}{\out{
}} +```{r cache-delete, eval = FALSE} +cache_delete(package = "knitr") +cache_delete(platform = "macos") +``` + + +```{r cache-clean, eval = FALSE} +cache_clean() +``` } diff --git a/man/faq.Rd b/man/faq.Rd index c5b9874a2..052c48219 100644 --- a/man/faq.Rd +++ b/man/faq.Rd @@ -5,160 +5,7 @@ \title{Frequently Asked Questions} \description{ Please take a look at this list before asking questions. -} -\section{Package installation}{ -\subsection{How do I reinstall a package?}{ - -pak does not reinstall a package, if the same version is already installed. -Sometimes you still want a reinstall, e.g. to fix a broken installation. -In this case you can delete the package and then install it, or use the -\code{?reinstall} parameter: - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 13 packages.                                             
-#> → All 13 packages (7.68 MB) are cached.                                 
-#> + cli         3.3.0                                                     
-#> + crayon      1.5.1                                                     
-#> + ellipsis    0.3.2                                                     
-#> + fansi       1.0.3                                                     
-#> + glue        1.6.2                                                     
-#> + lifecycle   1.0.1                                                     
-#> + magrittr    2.0.3                                                     
-#> + pillar      1.7.0                                                     
-#> + pkgconfig   2.0.3                                                     
-#> + rlang       1.0.2                                                     
-#> + tibble      3.1.7                                                     
-#> + utf8        1.2.2                                                     
-#> + vctrs       0.4.1                                                     
-#>  No downloads are needed, 13 pkgs (7.68 MB) are cached                 
-#>  Got utf8 1.2.2 (aarch64-apple-darwin20) (209.24 kB)                   
-#>  Installed cli 3.3.0  (76ms)                                           
-#>  Installed crayon 1.5.1  (87ms)                                        
-#>  Installed ellipsis 0.3.2  (97ms)                                      
-#>  Installed fansi 1.0.3  (103ms)                                        
-#>  Installed glue 1.6.2  (111ms)                                         
-#>  Installed lifecycle 1.0.1  (153ms)                                    
-#>  Installed magrittr 2.0.3  (158ms)                                     
-#>  Installed pillar 1.7.0  (162ms)                                       
-#>  Installed pkgconfig 2.0.3  (87ms)                                     
-#>  Installed rlang 1.0.2  (39ms)                                         
-#>  Installed tibble 3.1.7  (41ms)                                        
-#>  Installed utf8 1.2.2  (39ms)                                          
-#>  Installed vctrs 0.4.1  (32ms)                                         
-#>  1 pkg + 12 deps: added 13, dld 1 (209.24 kB) [1.8s]                   
-
-}} - - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble?reinstall") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 1 package.                                               
-#> → The package (724.32 kB) is cached.                                    
-#> + tibble   3.1.7                                                        
-#>  No downloads are needed, 1 pkg (724.32 kB) is cached                  
-#>  Installed tibble 3.1.7  (42ms)                                        
-#>  1 pkg + 12 deps: kept 11, added 1 [343ms]                             
-
-}} +```{r child = "man/chunks/FAQ.Rmd"} +``` } - -\subsection{How do I install a dependency from a binary package}{ - -Sometimes it is suffifient to install the binary package of an older -version of a dependency, instead of the newer source package that -potentially needs compilers, system tools or libraries. - -\code{pkg_install()} and \code{lockfile_create()} default to \code{upgrade = FALSE}, which -always chooses binaries over source packages, so if you use \code{pkg_install()} -you don't need to do anything extra. - -The \verb{local_install_*} functions default to \code{upgrade = TRUE}, as does \code{pak()} -with \code{pkf = NULL}, so for these you need to explicitly use \code{upgrade = FALSE}. -} - -\subsection{How do I install a package from source?}{ - -To force the installation of a source package (instead of a binary -package), use the \code{?source} parameter: - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble?source") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 1 package.                                               
-#> → The package (672.34 kB) is cached.                                    
-#> + tibble   3.1.7 👷🏼‍♀️🔧                                                 
-#>  No downloads are needed, 1 pkg (672.34 kB) is cached                  
-#>  Building tibble 3.1.7                                                 
-#>  Built tibble 3.1.7 (3.1s)                                             
-#>  Installed tibble 3.1.7  (35ms)                                        
-#>  1 pkg + 12 deps: kept 11, added 1 [4.1s]                              
-
-}} - -} - -\subsection{How do I install the latest version of a dependency?}{ - -If you want to always install a dependency from source, because you want -the latest version or some other reason, you can use the \code{source} -parameter with the \verb{=} form: \verb{=?source}. -For example to install tibble, with its cli dependency installed from -source you could write: - -\if{html}{\out{
}}\preformatted{pak::pkg_install(c("tibble", "cli=?source")) -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 1 package.                                               
-#> → The package (540.04 kB) is cached.                                    
-#> + cli   3.3.0 👷🏽🔧                                                       
-#>  No downloads are needed, 1 pkg (540.04 kB) is cached                  
-#>  Building cli 3.3.0                                                    
-#>  Built cli 3.3.0 (4.5s)                                                
-#>  Installed cli 3.3.0  (68ms)                                           
-#>  1 pkg + 12 deps: kept 11, added 1 [4.9s]                              
-
-}} - -} - -\subsection{How do I ignore an optional dependency?}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_install( - c("tibble", "DiagrammeR=?ignore", "formattable=?ignore"), - dependencies = TRUE -) -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#>  No downloads are needed                                               
-#>  1 pkg + 12 deps: kept 12 [583ms]                                      
-
-}} - - -The syntax is - -\if{html}{\out{
}}\preformatted{=?ignore -}\if{html}{\out{
}} - -Note that you can only ignore \emph{optional} dependencies, i.e. packages in -\code{Suggests} and \code{Enhances}. -} -} - -\section{Others}{ -\subsection{How can I use pak with renv?}{ - -You cannot currently, but keep on eye on this issue: -https://github.com/r-lib/pak/issues/343 -} -} - diff --git a/man/features.Rd b/man/features.Rd index 4ab565cf4..8ac1c6266 100644 --- a/man/features.Rd +++ b/man/features.Rd @@ -5,121 +5,7 @@ \title{A list of the most important pak features} \description{ A list of the most important pak features. -} -\section{pak is fast}{ -\subsection{Parallel HTTP}{ - -pak performs HTTP queries concurrently. This is true when -\itemize{ -\item it downloads package metadata from package repositories, -\item it resolves packages from CRAN, GitHub, URLs, etc, -\item it downloads the actual package files, -\item etc. -} -} - -\subsection{Parallel installation}{ - -pak installs packages concurrently, as much as their dependency graph -allows this. -} - -\subsection{Caching}{ - -pak caches metadata and package files, so you don't need to re-download -the same files over and over. -} -} - -\section{pak is safe}{ -\subsection{Plan installation up front}{ - -pak creates an installation plan before downloading any packages. -If the plan is unsuccessful, then it fails without downloading any -packages. -} - -\subsection{Auto-install missing dependencies}{ - -When requesting the installation of a package, pak makes sure that all -of its dependencies are also installed. -} - -\subsection{Keeping binary packages up-to-date}{ - -pak automatically discards binary packages from the cache, if a new build -of the same version is available on CRAN. -} - -\subsection{Correct CRAN metadata errors}{ - -pak can correct some of CRAN's metadata issues, e.g.: -\itemize{ -\item New version of the package was released since we obtained the metadata. -\item macOS binary package is only available at https://mac.r-project.org/ -because of a synchronization issue. -} -} - -\subsection{Graceful handling of locked package DLLs on Windows}{ - -pak handles the situation of locked package DLLs, as well as possible. -It detects which process locked them, and offers the choice of terminating -these processes. It also unloads packages from the current R session as -needed. -} - -\subsection{pak keeps its own dependencies isolated}{ - -pak keeps its own dependencies in a private package library and never -loads any packages. (Only in background processes). -} -} - -\section{pak is convenient}{ -\subsection{pak comes as a self-contained binary package}{ - -On the most common platforms. No dependencies, no system dependencies, -no compiler needed. (See also the \link[=Installing pak]{installation} manual.) -} - -\subsection{Install packages from multiple sources}{ -\itemize{ -\item CRAN, Bioconductor -\item GitHub -\item URLs -\item Local files or directories. -} -} - -\subsection{Ignore certain optional dependencies}{ - -pak can ignore certain optional dependencies if requested. -} - -\subsection{CRAN package file sizes}{ -pak knows the sizes of CRAN package files, so it can estimate how much -data you need to download, before the installation. +```{r child = "man/chunks/features.Rmd"} +``` } - -\subsection{Bioconductor version detection}{ - -pak automatically selects the Bioconductor version that is appropriate for -your R version. No need to set any repositories. -} - -\subsection{Time travel with MRAN or RSPM}{ - -pak can use MRAN (Microsoft R Application Network, -https://mran.microsoft.com/) or RSPM (RStudio Public Package Manager, -https://packagemanager.rstudio.com/client/#/) to install from snapshots -or CRAN. -} - -\subsection{pak can install dependencies of local packages}{ - -Very handy for package development! -} -} - diff --git a/man/get-started.Rd b/man/get-started.Rd index e9140ad4c..cbaf0e7da 100644 --- a/man/get-started.Rd +++ b/man/get-started.Rd @@ -6,823 +6,7 @@ \description{ You don't need to read long manual pages for a simple task. This manual page collects the most common pak use cases. -} -\section{Package installation}{ -\subsection{Install a package from CRAN or Bioconductor}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble") -}\if{html}{\out{
}} - -\if{html}{\figure{tldr-cran.svg}} - -pak automatically sets a CRAN repository and the Bioconductor repositories -that correspons to the current R version. -} - -\subsection{Install a package from GitHub}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tidyverse/tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → 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: 2d7de76)                    
-#>  No downloads are needed, 2 pkgs are cached                            
-#>  Packaging vctrs 0.5.1.9000                                            
-#>  Packaged vctrs 0.5.1.9000 (1.4s)                                      
-#>  Building vctrs 0.5.1.9000                                             
-#>  Built vctrs 0.5.1.9000 (11.2s)                                        
-#>  Installed vctrs 0.5.1.9000 (github::r-lib/vctrs@2d7de76) (34ms)       
-#>  Packaging tibble 3.1.8.9002                                           
-#>  Packaged tibble 3.1.8.9002 (502ms)                                    
-#>  Building tibble 3.1.8.9002                                            
-#>  Built tibble 3.1.8.9002 (2.7s)                                        
-#>  Installed tibble 3.1.8.9002 (github::tidyverse/tibble@37ec86a) (28ms) 
-#>  1 pkg + 10 deps: kept 9, upd 2 [17.5s]                                
-
-}} - - -Use the \code{user/repo} form. -You can specify a branch or tag: \code{user/repo@branch} or \code{user/repo@tag}. -} - -\subsection{Install a package from a URL}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_install( - "url::https://cran.r-project.org/src/contrib/Archive/tibble/tibble_3.1.7.tar.gz" -) -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 1 package.                                               
-#> → Will update 1 package.                                                
-#> → All 2 packages (38.65 kB) are cached.                                 
-#> + ellipsis              0.3.2                                           
-#> + tibble   3.1.8.9002 → 3.1.7 👷🏻‍♀️🔧                                    
-#>  No downloads are needed, 2 pkgs (38.65 kB) are cached                 
-#>  Installed ellipsis 0.3.2  (18ms)                                      
-#>  Building tibble 3.1.7                                                 
-#>  Built tibble 3.1.7 (2.5s)                                             
-#>  Installed tibble 3.1.7  (31ms)                                        
-#>  1 pkg + 11 deps: kept 10, upd 1, added 1 [3.3s]                       
-
-}} - - -The URL may point to an R package file, made with \verb{R CMD build}, or a -\code{.tar.gz} or \code{.zip} archive of a package tree. -} -} - -\section{Package updates}{ -\subsection{Update a package}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → 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  (36ms)                                        
-#>  1 pkg + 10 deps: kept 10, upd 1 [368ms]                               
-
-}} - - -\code{pak::pkg_install()} automatically updates the package. -} - -\subsection{Update all dependencies of a package}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble", upgrade = TRUE) -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#>  No downloads are needed                                               
-#>  1 pkg + 10 deps: kept 11 [278ms]                                      
-
-}} - - -\code{upgrade = TRUE} updates the package itself and all of its dependencies, if -necessary. -} - -\subsection{Reinstall a package}{ - -Add \code{?reinstall} to the package name or package reference in general: - -\if{html}{\out{
}}\preformatted{pak::pkg_install("tibble?reinstall") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 1 package.                                               
-#> → The package (724.32 kB) is cached.                                    
-#> + tibble   3.1.8                                                        
-#>  No downloads are needed, 1 pkg (724.32 kB) is cached                  
-#>  Installed tibble 3.1.8  (60ms)                                        
-#>  1 pkg + 10 deps: kept 10, added 1 [340ms]                             
-
-}} - -} -} - -\section{Dependency lookup}{ -\subsection{Dependencies of a CRAN or Bioconductor package}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_deps("tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 11 × 32                                                 
-#>    ref       type  direct direc…¹ status package version license needs…²
-#>    <chr>     <chr> <lgl>  <lgl>   <chr>  <chr>   <chr>   <chr>   <lgl>  
-#>  1 cli       stan… FALSE  FALSE   OK     cli     3.4.1   MIT + … FALSE  
-#>  2 fansi     stan… FALSE  FALSE   OK     fansi   1.0.3   GPL-2 … FALSE  
-#>  3 glue      stan… FALSE  FALSE   OK     glue    1.6.2   MIT + … FALSE  
-#>  4 lifecycle stan… FALSE  FALSE   OK     lifecy… 1.0.3   MIT + … FALSE  
-#>  5 magrittr  stan… FALSE  FALSE   OK     magrit… 2.0.3   MIT + … FALSE  
-#>  6 pillar    stan… FALSE  FALSE   OK     pillar  1.8.1   MIT + … FALSE  
-#>  7 pkgconfig stan… FALSE  FALSE   OK     pkgcon… 2.0.3   MIT + … FALSE  
-#>  8 rlang     stan… FALSE  FALSE   OK     rlang   1.0.6   MIT + … FALSE  
-#>  9 tibble    stan… TRUE   TRUE    OK     tibble  3.1.8   MIT + … FALSE  
-#> 10 utf8      stan… FALSE  FALSE   OK     utf8    1.2.2   Apache… FALSE  
-#> 11 vctrs     stan… FALSE  FALSE   OK     vctrs   0.5.1   MIT + … FALSE  
-#> # … with 23 more variables: priority <chr>, 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, …    
-
-}} - - -The results are returned in a data frame. -} - -\subsection{Dependency tree of a CRAN / Bioconductor package}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_deps_tree("tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> 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                                                             
-
-}} - - -The results are also silently returned in a data frame. -} - -\subsection{Dependency tree of a package on GitHub}{ - -\if{html}{\out{
}}\preformatted{pak::pkg_deps_tree("tidyverse/tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> tidyverse/tibble 3.1.8.9002 ✨👷🏼🔧                                        
-#> ├─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                                                         
-#> │ └─r-lib/vctrs 0.5.1.9000 ✨👷🏼🔧                                         
-#> │   ├─cli                                                               
-#> │   ├─glue                                                              
-#> │   ├─lifecycle                                                         
-#> │   └─rlang                                                             
-#> ├─pkgconfig 2.0.3                                                      
-#> ├─rlang                                                                 
-#> └─r-lib/vctrs                                                           
-#>                                                                         
-#> Key:   new | 👷🏼 build | 🔧 compile                                      
-
-}} - - -Use the \code{user/repo} form. -As usual, you can also select a branch, tag, or sha, with the -\code{user/repo@branch}, \code{user/repo@tag} or \code{user/repo@sha} forms. -} - -\subsection{Dependency tree of the package in the current directory}{ - -\if{html}{\out{
}}\preformatted{pak::local_deps_tree("tibble") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> local::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 | 👷🏻‍♀️ build | 🔧 compile                                   
-
-}} - - -Assuming package is in directory \code{tibble}. -} - -\subsection{Explain a recursive dependency}{ - -How does tibble depend on rlang? - -\if{html}{\out{
}}\preformatted{pak::pkg_deps_explain("tibble", "rlang") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> 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                                                
-
-}} - - -Use can also use the \code{user/repo} form for packages from GitHub, -\code{url::...} for packages at URLs, etc. -} -} - -\section{Package development}{ -\subsection{Install dependencies of local package}{ - -\if{html}{\out{
}}\preformatted{pak::local_install_deps() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Loading metadata database ... done                                    
-#>                                                                         
-#> → The package (0 B) is cached.                                          
-#>  No downloads are needed                                               
-#>  10 deps: kept 10 [3.2s]                                               
-
-}} - -} - -\subsection{Install local package}{ - -\if{html}{\out{
}}\preformatted{pak::local_install() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → 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 (864ms)                                         
-#>  Building tibble 3.1.8                                                 
-#>  Built tibble 3.1.8 (2.4s)                                             
-#>  Installed tibble 3.1.8 (local) (38ms)                                 
-#>  1 pkg + 10 deps: kept 10, upd 1, dld 1 (NA B) [4.2s]                  
-
-}} +```{r child = "man/chunks/tldr.Rmd"} +``` } - -\subsection{Install all dependencies of local package}{ - -\if{html}{\out{
}}\preformatted{pak::local_install_dev_deps() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 86 packages.                                             
-#> → Will update 2 packages.                                               
-#> → All 89 packages (100.53 MB) are cached.                               
-#> + askpass                1.1                                            
-#> + base64enc              0.1-3                                          
-#> + bench                  1.1.2                                          
-#> + bit                    4.0.5                                          
-#> + bit64                  4.0.5                                          
-#> + blob                   1.2.3                                          
-#> + brio                   1.1.3                                          
-#> + bslib                  0.4.1                                          
-#> + cachem                 1.0.6                                          
-#> + callr                  3.7.3                                          
-#> + clipr                  0.8.0                                          
-#> + colorspace             2.0-3                                          
-#> + covr                   3.6.1                                          
-#> + crayon                 1.5.2                                          
-#> + curl                   4.3.3                                          
-#> + desc                   1.4.2                                          
-#> + DiagrammeR             1.0.9                                          
-#> + diffobj                0.3.5                                          
-#> + digest                 0.6.31                                         
-#> + downloader             0.4                                            
-#> + dplyr                  1.0.10                                         
-#> + evaluate               0.19    👷🏿‍♂️                                  
-#> + farver                 2.1.1                                          
-#> + fastmap                1.1.0                                          
-#> + formattable            0.2.1                                          
-#> + fs                     1.5.2                                          
-#> + generics               0.1.3                                          
-#> + ggplot2                3.4.0                                          
-#> + gridExtra              2.3                                            
-#> + gtable                 0.3.1                                          
-#> + highr                  0.9                                            
-#> + hms                    1.1.2                                          
-#> + htmltools              0.5.4                                          
-#> + htmlwidgets            1.6.0   👷🏾‍♂️                                  
-#> + httr                   1.4.4                                          
-#> + igraph                 1.3.5                                          
-#> + influenceR             0.1.0.1                                        
-#> + isoband                0.2.6                                          
-#> + jquerylib              0.1.4                                          
-#> + jsonlite               1.8.4                                          
-#> + knitr                  1.41                                           
-#> + labeling               0.4.2                                          
-#> + lazyeval               0.2.2                                          
-#> + lubridate              1.9.0                                          
-#> + Matrix       1.5-1   → 1.5-3                                          
-#> + memoise                2.0.1                                          
-#> + mime                   0.12                                           
-#> + mockr                  0.2.0                                          
-#> + munsell                0.5.0                                          
-#> + nlme         3.1-160 → 3.1-161 👷‍♂️🔧                                  
-#> + nycflights13           1.0.2                                          
-#> + openssl                2.0.5                                          
-#> + pkgbuild               1.4.0                                          
-#> + pkgload                1.3.2                                          
-#> + praise                 1.0.0                                          
-#> + prettyunits            1.1.1                                          
-#> + processx               3.8.0                                          
-#> + profmem                0.6.0                                          
-#> + ps                     1.7.2                                          
-#> + purrr                  0.3.5                                          
-#> + R6                     2.5.1                                          
-#> + rappdirs               0.3.3                                          
-#> + RColorBrewer           1.1-3                                          
-#> + readr                  2.1.3                                          
-#> + rematch2               2.1.2                                          
-#> + rex                    1.2.1                                          
-#> + rmarkdown              2.19    👷‍♂️                                   
-#> + rprojroot              2.0.3                                          
-#> + rstudioapi             0.14                                           
-#> + sass                   0.4.4                                          
-#> + scales                 1.2.1                                          
-#> + stringi                1.7.8                                          
-#> + stringr                1.5.0                                          
-#> + sys                    3.4.1                                          
-#> + testthat               3.1.6                                          
-#> + tidyr                  1.2.1                                          
-#> + tidyselect             1.2.0                                          
-#> + timechange             0.1.1                                          
-#> + tinytex                0.43    👷🏻‍♂️                                  
-#> + tzdb                   0.3.0                                          
-#> + viridis                0.6.2                                          
-#> + viridisLite            0.4.1                                          
-#> + visNetwork             2.1.2                                          
-#> + vroom                  1.6.0                                          
-#> + waldo                  0.4.0                                          
-#> + withr                  2.5.0                                          
-#> + xfun                   0.35                                           
-#> + yaml                   2.3.6                                          
-#>  No downloads are needed, 88 pkgs (100.53 MB) are cached               
-#>  Packaging tibble 3.1.8                                                
-#>  Building evaluate 0.19                                                
-#>  Building nlme 3.1-161                                                 
-#>  Installed R6 2.5.1  (31ms)                                            
-#>  Installed DiagrammeR 1.0.9  (76ms)                                    
-#>  Installed RColorBrewer 1.1-3  (72ms)                                  
-#>  Installed askpass 1.1  (79ms)                                         
-#>  Installed Matrix 1.5-3  (137ms)                                       
-#>  Installed base64enc 0.1-3  (125ms)                                    
-#>  Installed bench 1.1.2  (90ms)                                         
-#>  Installed bit64 4.0.5  (44ms)                                         
-#>  Installed bit 4.0.5  (43ms)                                           
-#>  Installed blob 1.2.3  (41ms)                                          
-#>  Installed brio 1.1.3  (40ms)                                          
-#>  Installed cachem 1.0.6  (31ms)                                        
-#>  Installed callr 3.7.3  (53ms)                                         
-#>  Installed clipr 0.8.0  (89ms)                                         
-#>  Installed colorspace 2.0-3  (99ms)                                    
-#>  Installed covr 3.6.1  (58ms)                                          
-#>  Installed crayon 1.5.2  (75ms)                                        
-#>  Installed curl 4.3.3  (83ms)                                          
-#>  Packaged tibble 3.1.8 (684ms)                                         
-#>  Installed bslib 0.4.1  (315ms)                                        
-#>  Installed desc 1.4.2  (77ms)                                          
-#>  Installed diffobj 0.3.5  (68ms)                                       
-#>  Installed digest 0.6.31  (60ms)                                       
-#>  Installed downloader 0.4  (39ms)                                      
-#>  Installed dplyr 1.0.10  (39ms)                                        
-#>  Installed farver 2.1.1  (41ms)                                        
-#>  Installed fastmap 1.1.0  (38ms)                                       
-#>  Installed formattable 0.2.1  (43ms)                                   
-#>  Built evaluate 0.19 (903ms)                                           
-#>  Installed fs 1.5.2  (49ms)                                            
-#>  Installed generics 0.1.3  (46ms)                                      
-#>  Installed ggplot2 3.4.0  (65ms)                                       
-#>  Installed gridExtra 2.3  (43ms)                                       
-#>  Installed gtable 0.3.1  (38ms)                                        
-#>  Installed highr 0.9  (37ms)                                           
-#>  Installed hms 1.1.2  (39ms)                                           
-#>  Installed htmltools 0.5.4  (40ms)                                     
-#>  Installed httr 1.4.4  (40ms)                                          
-#>  Installed influenceR 0.1.0.1  (17ms)                                  
-#>  Installed igraph 1.3.5  (96ms)                                        
-#>  Installed isoband 0.2.6  (68ms)                                       
-#>  Installed jquerylib 0.1.4  (38ms)                                     
-#>  Installed jsonlite 1.8.4  (37ms)                                      
-#>  Installed labeling 0.4.2  (14ms)                                      
-#>  Installed knitr 1.41  (73ms)                                          
-#>  Installed lazyeval 0.2.2  (43ms)                                      
-#>  Installed lubridate 1.9.0  (38ms)                                     
-#>  Installed memoise 2.0.1  (39ms)                                       
-#>  Installed mime 0.12  (58ms)                                           
-#>  Installed mockr 0.2.0  (38ms)                                         
-#>  Installed munsell 0.5.0  (36ms)                                       
-#>  Installed nycflights13 1.0.2  (37ms)                                  
-#>  Installed openssl 2.0.5  (41ms)                                       
-#>  Installed pkgbuild 1.4.0  (39ms)                                      
-#>  Installed pkgload 1.3.2  (37ms)                                       
-#>  Installed praise 1.0.0  (35ms)                                        
-#>  Installed prettyunits 1.1.1  (56ms)                                   
-#>  Installed processx 3.8.0  (37ms)                                      
-#>  Installed profmem 0.6.0  (37ms)                                       
-#>  Installed ps 1.7.2  (37ms)                                            
-#>  Installed purrr 0.3.5  (38ms)                                         
-#>  Installed rappdirs 0.3.3  (37ms)                                      
-#>  Installed readr 2.1.3  (42ms)                                         
-#>  Installed rematch2 2.1.2  (41ms)                                      
-#>  Installed rex 1.2.1  (58ms)                                           
-#>  Installed rprojroot 2.0.3  (58ms)                                     
-#>  Installed rstudioapi 0.14  (40ms)                                     
-#>  Installed sass 0.4.4  (42ms)                                          
-#>  Installed scales 1.2.1  (39ms)                                        
-#>  Installed stringr 1.5.0  (33ms)                                       
-#>  Installed sys 3.4.1  (49ms)                                           
-#>  Installed testthat 3.1.6  (88ms)                                      
-#>  Installed tidyr 1.2.1  (77ms)                                         
-#>  Installed stringi 1.7.8  (195ms)                                      
-#>  Installed tidyselect 1.2.0  (113ms)                                   
-#>  Installed timechange 0.1.1  (55ms)                                    
-#>  Installed tzdb 0.3.0  (40ms)                                          
-#>  Installed viridisLite 0.4.1  (39ms)                                   
-#>  Installed viridis 0.6.2  (39ms)                                       
-#>  Installed visNetwork 2.1.2  (77ms)                                    
-#>  Installed vroom 1.6.0  (77ms)                                         
-#>  Installed waldo 0.4.0  (62ms)                                         
-#>  Installed withr 2.5.0  (40ms)                                         
-#>  Installed xfun 0.35  (39ms)                                           
-#>  Building tinytex 0.43                                                 
-#>  Installed yaml 2.3.6  (43ms)                                          
-#>  Installed evaluate 0.19  (15ms)                                       
-#>  Built tinytex 0.43 (1.1s)                                             
-#>  Installed tinytex 0.43  (15ms)                                        
-#>  Building rmarkdown 2.19                                               
-#>  Built rmarkdown 2.19 (3.9s)                                           
-#>  Installed rmarkdown 2.19  (85ms)                                      
-#>  Building htmlwidgets 1.6.0                                            
-#>  Built nlme 3.1-161 (8s)                                               
-#>  Installed nlme 3.1-161  (33ms)                                        
-#>  Built htmlwidgets 1.6.0 (1.1s)                                        
-#>  Installed htmlwidgets 1.6.0  (22ms)                                   
-#>  103 deps: kept 15, upd 2, added 86 [10.2s]                            
-
-}} - - -Installs development and optional dependencies as well. -} -} - -\section{Repositories}{ -\subsection{List current repositories}{ - -\if{html}{\out{
}}\preformatted{pak::repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # 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… bioc  4.2.2   3.16   
-#> 3 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 4 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} - - -If you haven't set a CRAN or Bioconductor repository, pak does that -automatically. -} - -\subsection{Add custom repository}{ - -\if{html}{\out{
}}\preformatted{pak::repo_add(rhub = 'https://r-hub.r-universe.dev') -pak::repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # 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… bioc  4.2.2   3.16   
-#> 4 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 6 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} - -} - -\subsection{Remove custom repositories}{ - -\if{html}{\out{
}}\preformatted{options(repos = getOption("repos")["CRAN"]) -pak::repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # 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… bioc  4.2.2   3.16   
-#> 3 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 4 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} - - -If you set the \code{repos} option to a CRAN repo only, or unset it completely, -then pak keeps only CRAN and (by default) Bioconductor. -} - -\subsection{Time travel using RSPM}{ - -\if{html}{\out{
}}\preformatted{pak::repo_add(CRAN = "RSPM@2022-06-30") -pak::repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 5 × 5                                                   
-#>   name          url                                type  r_ver…¹ bioc_…²
-#> * <chr>         <chr>                              <chr> <chr>   <chr>  
-#> 1 CRAN          https://packagemanager.posit.co/c… cran  *       NA     
-#> 2 BioCsoft      https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 3 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 4 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} - - -Sets a repository that is equivalent to CRAN's state closest to the -specified date. -Name this repository \code{CRAN}, otherwise pak will also add a default CRAN -repository. -} - -\subsection{Time travel using MRAN}{ - -\if{html}{\out{
}}\preformatted{pak::repo_add(CRAN = "MRAN@2022-06-30") -pak::repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 5 × 5                                                   
-#>   name          url                                type  r_ver…¹ bioc_…²
-#> * <chr>         <chr>                              <chr> <chr>   <chr>  
-#> 1 CRAN          https://cran.microsoft.com/snapsh… cran  *       NA     
-#> 2 BioCsoft      https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 3 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 4 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} - - -Sets a repository that is equivalent to CRAN's state at the specified date. -Name this repository \code{CRAN}, otherwise pak will also add a default CRAN -repository. -} -} - -\section{Caches}{ -By default pak caches both metadata and downloaded packages. -\subsection{Inspect metadata cache}{ - -\if{html}{\out{
}}\preformatted{pak::meta_list() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Updated metadata database: 4.55 MB in 4 files.                        
-#>  Updating metadata database ... done                                   
-#> # A data frame: 43,718 × 32                                             
-#>    package version depends sugge…¹ license imports linki…² archs enhan…³
-#>    <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr> <chr>  
-#>  1 A3      1.0.0   R (>= … random… GPL (>… NA      NA      NA    NA     
-#>  2 AATtoo… 0.0.1   R (>= … NA      GPL-3   magrit… NA      NA    NA     
-#>  3 ABACUS  1.0.0   R (>= … rmarkd… GPL-3   ggplot… NA      NA    NA     
-#>  4 ABC.RAP 0.9.0   R (>= … knitr,… GPL-3   graphi… NA      NA    NA     
-#>  5 ABCana… 1.2.1   R (>= … NA      GPL-3   plotrix NA      NA    NA     
-#>  6 ABCopt… 0.15.0  NA      testth… MIT + … Rcpp, … Rcpp    ABCo… NA     
-#>  7 ABCp2   1.2     MASS    NA      GPL-2   NA      NA      NA    NA     
-#>  8 ABHgen… 1.0.1   NA      knitr,… GPL-3   ggplot… NA      NA    NA     
-#>  9 ABPS    0.3     NA      testth… GPL (>… kernlab NA      NA    NA     
-#> 10 ACA     1.1     R (>= … NA      GPL     graphi… NA      NA    NA     
-#> # … with 43,708 more rows, 23 more variables: os_type <chr>,            
-#> #   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 …      
-
-}} - -} - -\subsection{Update metadata cache}{ - -By default \code{pkg_install()} and similar functions automatically update the -metadata for the currently set repositories if it is older than 24 hours. -You can also force an update manually: - -\if{html}{\out{
}}\preformatted{pak::meta_update() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Updating metadata database ... done                                   
-
-}} - -} - -\subsection{Clean metadata cache}{ - -\if{html}{\out{
}}\preformatted{pak::meta_clean(force = TRUE) -pak::meta_summary() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metad
-#> ata"                                                                    
-#>                                                                         
-#> $current_db                                                             
-#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metad
-#> ata/pkgs-d1c324e625.rds"                                                
-#>                                                                         
-#> $raw_files                                                              
-#> character(0)                                                            
-#>                                                                         
-#> $db_files                                                               
-#> character(0)                                                            
-#>                                                                         
-#> $size                                                                   
-#> [1] 0                                                                   
-#>                                                                         
-
-}} - -} - -\subsection{Inspect package cache}{ - -Downloaded packages are also cached. - -\if{html}{\out{
}}\preformatted{pak::cache_list() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 480 × 11                                                
-#>    fullpath       path  package url   etag  sha256 version platf…¹ built
-#>    <chr>          <chr> <chr>   <chr> <chr> <chr>  <chr>   <chr>   <int>
-#>  1 /Users/gaborc… arch… NA      http… "\\"1… 0c8f0… NA      NA         NA
-#>  2 /Users/gaborc… bin/… evalua… http… "\\"1… 08a39… 0.17    aarch6…    NA
-#>  3 /Users/gaborc… bin/… crayon  http… "\\"2… 1e6d5… 1.5.2   aarch6…    NA
-#>  4 /Users/gaborc… bin/… common… http… "\\"4… 47b4a… 1.8.1   aarch6…    NA
-#>  5 /Users/gaborc… bin/… curl    http… "\\"b… 7b8ba… 4.3.3   aarch6…    NA
-#>  6 /Users/gaborc… bin/… tinytex http… "\\"2… 7e9ba… 0.42    aarch6…    NA
-#>  7 /Users/gaborc… bin/… jsonli… http… "\\"1… 68e59… 1.8.2   aarch6…    NA
-#>  8 /Users/gaborc… bin/… lifecy… http… "\\"1… 7ce27… 1.0.3   aarch6…    NA
-#>  9 /Users/gaborc… bin/… vctrs   http… "\\"1… c3a69… 0.4.2   aarch6…    NA
-#> 10 /Users/gaborc… src/… pkgcac… NA     NA   9b70a… NA      NA          0
-#> # … with 470 more rows, 2 more variables: vignettes <int>,              
-#> #   rversion <chr>, and abbreviated variable name ¹​platform            
-
-}} - -} - -\subsection{View a package cache summary}{ - -\if{html}{\out{
}}\preformatted{pak::cache_summary() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> $cachepath                                                              
-#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/pkg"  
-#>                                                                         
-#> $files                                                                  
-#> [1] 480                                                                 
-#>                                                                         
-#> $size                                                                   
-#> [1] 653325143                                                           
-#>                                                                         
-
-}} - -} - -\subsection{Clean package cache}{ - -\if{html}{\out{
}}\preformatted{pak::cache_clean() -}\if{html}{\out{
}} -} -} - -\section{Libraries}{ -\subsection{List packages in a library}{ - -\if{html}{\out{
}}\preformatted{pak::lib_status(Sys.getenv("R_LIBS_USER")) -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 701 × 39                                                
-#>    library   package title version depends repos…¹ license needs…² built
-#>    <chr>     <chr>   <chr> <chr>   <chr>   <chr>   <chr>   <lgl>   <chr>
-#>  1 /Users/g… abc     "Too… 2.2.1   R (>= … CRAN    GPL (>… FALSE   R 4.…
-#>  2 /Users/g… abc.da… "Dat… 1.0     R (>= … CRAN    GPL (>… FALSE   R 4.…
-#>  3 /Users/g… abind   "Com… 1.4-5   R (>= … CRAN    LGPL (… FALSE   R 4.…
-#>  4 /Users/g… ade4    "Ana… 1.7-19  R (>= … CRAN    GPL (>… TRUE    R 4.…
-#>  5 /Users/g… ape     "Ana… 5.6-2   R (>= … CRAN    GPL-2 … TRUE    R 4.…
-#>  6 /Users/g… aplot   "Dec… 0.1.7   NA      CRAN    Artist… FALSE   R 4.…
-#>  7 /Users/g… archive "Mul… 1.1.5   R (>= … CRAN    MIT + … TRUE    R 4.…
-#>  8 /Users/g… arrayh… "Con… 1.1-0   NA      CRAN    GPL     FALSE   R 4.…
-#>  9 /Users/g… arrow   "Int… 9.0.0   R (>= … CRAN    Apache… TRUE    R 4.…
-#> 10 /Users/g… arules  "Min… 1.7-5   R (>= … CRAN    GPL-3   TRUE    R 4.…
-#> # … with 691 more rows, 30 more variables: remotetype <chr>,            
-#> #   remotepkgref <chr>, remoteref <chr>, remoterepos <chr>,             
-#> #   remotepkgplatform <chr>, remotesha <chr>, imports <chr>,            
-#> #   suggests <chr>, linkingto <chr>, remotes <chr>, remotehost <chr>,   
-#> #   remoterepo <chr>, remoteusername <chr>, enhances <chr>,             
-#> #   biocviews <chr>, remoteurl <chr>, remotesubdir <chr>,               
-#> #   priority <chr>, remoteetag <chr>, remotepackaged <chr>, …           
-
-}} - - -Pass the directory of the library as the argument. -} -} - diff --git a/man/handle_package_not_found.Rd b/man/handle_package_not_found.Rd index 6ff216629..d0cd2e86e 100644 --- a/man/handle_package_not_found.Rd +++ b/man/handle_package_not_found.Rd @@ -7,7 +7,7 @@ handle_package_not_found(err) } \arguments{ -\item{err}{The error object, of class \code{packageNotFoundError}.} +\item{err}{The error object, of class `packageNotFoundError`.} } \value{ Nothing. @@ -20,25 +20,26 @@ and in some cases it can also remedy the error and restart the code. } \details{ You are not supposed to call this function directly. Instead, set it -up as a global error handler, possibly in your \code{.Rprofile} file: +up as a global error handler, possibly in your `.Rprofile` file: -\if{html}{\out{
}}\preformatted{if (interactive() && getRversion() >= "4.0.0") \{ +```r +if (interactive() && getRversion() >= "4.0.0") { globalCallingHandlers( - packageNotFoundError = function(err) \{ + packageNotFoundError = function(err) { try(pak::handle_package_not_found(err)) - \} + } ) -\} -}\if{html}{\out{
}} +} +``` Global error handlers are only supported in R 4.0.0 and later. -Currently \code{handle_package_not_found()} does not do anything in +Currently `handle_package_not_found()` does not do anything in non-interactive mode (including in knitr, testthat and RStudio notebooks), this might change in the future. In some cases it is possible to remedy the original computation that tried to load the missing package, and pak will offer you to do so after a successful installation. Currently, in R 4.0.4, it is not -possible to continue a failed \code{library()} call. +possible to continue a failed `library()` call. } diff --git a/man/install.Rd b/man/install.Rd index 379c0aa90..5866d8096 100644 --- a/man/install.Rd +++ b/man/install.Rd @@ -6,89 +6,7 @@ \description{ Read this if the default installation methods do not work for you or if you want the release candidate or development version. -\subsection{Pre-built binaries}{ -Our pre-built binaries have the advantage that they are completely -self-containted and dependency free. -No additional R packages, system libraries or tools (e.g. compilers) are -needed for them. -Install a pre-built binary build of pak from our repository on GitHub: - -\if{html}{\out{
}}\preformatted{install.packages("pak", repos = sprintf( - "https://r-lib.github.io/p/pak/stable/\%s/\%s/\%s", - .Platform$pkgType, - R.Version()$os, - R.Version()$arch -)) -}\if{html}{\out{
}} - -This is supported for the following systems:\tabular{lll}{ - OS \tab CPU \tab R version \cr - Linux \tab x86_64 \tab R 3.4.0 - R-devel \cr - Linux \tab aarch64 \tab R 3.4.0 - R-devel \cr - macOS High Sierra+ \tab x86_64 \tab R 3.4.0 - R-devel \cr - macOS Big Sur+ \tab aarch64 \tab R 4.1.0 - R-devel \cr - Windows \tab x86_64 \tab R 3.4.0 - R-devel \cr -} - -\subsection{Notes}{ -\itemize{ -\item For macOS we only support the official CRAN R build. Other builds, e.g. -Homebrew R, are not supported. -\item We only support R builds that have an R shared library. CRAN's Windows -and macOS installers are such, so the the R builds in the common Linux -distributions. But this might be an issue if you build R yourself without -the \code{--enable-R-shlib} option. -} -} - -} - -\subsection{Install from CRAN}{ - -Install the released version of the package from CRAN as usual: - -\if{html}{\out{
}}\preformatted{install.packages("pak") -}\if{html}{\out{
}} - -This potentially needs a C compiler on platforms CRAN does not have -binaries packages for. -} - -\subsection{Nightly builds}{ - -We have nightly binary builds, for the same systems as the table above: - -\if{html}{\out{
}}\preformatted{install.packages("pak", repos = sprintf( - "https://r-lib.github.io/p/pak/devel/\%s/\%s/\%s", - .Platform$pkgType, - R.Version()$os, - R.Version()$arch -)) -}\if{html}{\out{
}} -\subsection{\code{stable}, \code{rc} and \code{devel} streams}{ - -We have three types of binaries available: -\itemize{ -\item \code{stable} corresponds to the latest CRAN release of CRAN. -\item \code{rc} is a release candidate build, and it is available about 1-2 weeks -before a release. Otherwise it is the same as the \code{stable} build. -\item \code{devel} has builds from the development tree. Before release it might be -the same as the \code{rc} build. -} - -The streams are available under different repository URLs: - -\if{html}{\out{
}}\preformatted{stream <- "rc" -install.packages("pak", repos = sprintf( - "https://r-lib.github.io/p/pak/\%s/\%s/\%s/\%s", - stream, - .Platform$pkgType, - R.Version()$os, - R.Version()$arch -)) -}\if{html}{\out{
}} -} - -} +```{r child = "man/chunks/install.Rmd"} +``` } diff --git a/man/lib_status.Rd b/man/lib_status.Rd index 764a32c58..812b18dff 100644 --- a/man/lib_status.Rd +++ b/man/lib_status.Rd @@ -14,40 +14,17 @@ pkg_list(lib = .libPaths()[1]) } \value{ Data frame the contains data about the packages -installed in the library. -\eval{include_docs("pkgdepends", "docs/lib-status-return.rds")} + installed in the library. + \eval{include_docs("pkgdepends", "docs/lib-status-return.rds")} } \description{ Status of packages in a library } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{lib_status(.Library) -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 31 × 31                                                 
-#>    library   package version prior…¹ title license sugge…² built depends
-#>    <chr>     <chr>   <chr>   <chr>   <chr> <chr>   <chr>   <chr> <chr>  
-#>  1 /Library… base    4.2.2   base    "The… Part o… methods R 4.… NA     
-#>  2 /Library… boot    1.3-28  recomm… "Boo… Unlimi… MASS, … R 4.… R (>= …
-#>  3 /Library… class   7.3-20  recomm… "Fun… GPL-2 … NA      R 4.… R (>= …
-#>  4 /Library… cluster 2.1.4   recomm… "\\"F… GPL (>… MASS, … R 4.… R (>= …
-#>  5 /Library… codeto… 0.2-18  recomm… "Cod… GPL     NA      R 4.… R (>= …
-#>  6 /Library… compil… 4.2.2   base    "The… Part o… NA      R 4.… NA     
-#>  7 /Library… datase… 4.2.2   base    "The… Part o… NA      R 4.… NA     
-#>  8 /Library… filelo… 1.0.2   NA      "Por… MIT + … callr … R 4.… NA     
-#>  9 /Library… foreign 0.8-83  recomm… "Rea… GPL (>… NA      R 4.… R (>= …
-#> 10 /Library… graphi… 4.2.2   base    "The… Part o… NA      R 4.… NA     
-#> # … with 21 more rows, 22 more variables: needscompilation <lgl>,       
-#> #   repository <chr>, imports <chr>, remotetype <chr>,                  
-#> #   remotepkgref <chr>, remoteref <chr>, remoterepos <chr>,             
-#> #   remotepkgplatform <chr>, remotesha <chr>, enhances <chr>,           
-#> #   linkingto <chr>, md5sum <chr>, platform <chr>, biocviews <chr>,     
-#> #   sysreqs <chr>, ref <chr>, type <chr>, status <chr>, rversion <chr>, 
-#> #   sources <list>, repotype <chr>, deps <list>, and abbreviated …      
-
-}} +```{asciicast lib-status-2} +lib_status(.Library) +``` } \seealso{ @@ -57,6 +34,7 @@ Other package functions: \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} diff --git a/man/local_deps.Rd b/man/local_deps.Rd index 7220d3271..2fc05d053 100644 --- a/man/local_deps.Rd +++ b/man/local_deps.Rd @@ -23,20 +23,18 @@ versions.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ All of these functions return the dependencies in a data -frame. \code{local_deps_tree()} and \code{local_dev_deps_tree()} also -print the dependency tree. + frame. `local_deps_tree()` and `local_dev_deps_tree()` also + print the dependency tree. } \description{ Dependencies of a package tree diff --git a/man/local_deps_explain.Rd b/man/local_deps_explain.Rd index c41dd490b..e615853ad 100644 --- a/man/local_deps_explain.Rd +++ b/man/local_deps_explain.Rd @@ -19,19 +19,17 @@ versions.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \description{ -These functions are similar to \code{\link[=pkg_deps_explain]{pkg_deps_explain()}}, but work on a -local package tree. \code{local_dev_deps_explain()} also includes development +These functions are similar to [pkg_deps_explain()], but work on a +local package tree. `local_dev_deps_explain()` also includes development dependencies. } \seealso{ diff --git a/man/local_install.Rd b/man/local_install.Rd index f7bb775c4..cf4c2e96e 100644 --- a/man/local_install.Rd +++ b/man/local_install.Rd @@ -15,22 +15,22 @@ local_install( \arguments{ \item{root}{Path to the package tree.} -\item{lib}{Package library to install the packages to. Note that \emph{all} +\item{lib}{Package library to install the packages to. Note that _all_ dependent packages will be installed here, even if they are already installed in another library. The only exceptions are base -and recommended packages installed in \code{.Library}. These are not -duplicated in \code{lib}, unless a newer version of a recommemded package +and recommended packages installed in `.Library`. These are not +duplicated in `lib`, unless a newer version of a recommemded package is needed.} -\item{upgrade}{When \code{FALSE}, the default, pak does the minimum amount -of work to give you the latest version(s) of \code{pkg}. It will only upgrade -dependent packages if \code{pkg}, or one of their dependencies explicitly -require a higher version than what you currently have. It will also -prefer a binary package over to source package, even it the binary -package is older. +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. -When \code{upgrade = TRUE}, pak will ensure that you have the latest -version(s) of \code{pkg} and all their dependencies.} + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} \item{ask}{Whether to ask for confirmation when installing a different version of a package that is already installed. Installations that only @@ -38,15 +38,13 @@ add new packages never require confirmation.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ Data frame, with information about the installed package(s). @@ -56,7 +54,7 @@ Installs a package tree (or source package file), together with its dependencies. } \details{ -\code{local_install()} is equivalent to \code{pkg_install("local::.")}. +`local_install()` is equivalent to `pkg_install("local::.")`. } \seealso{ Other local package trees: diff --git a/man/local_install_deps.Rd b/man/local_install_deps.Rd index f657cb128..31ac5afe3 100644 --- a/man/local_install_deps.Rd +++ b/man/local_install_deps.Rd @@ -15,22 +15,22 @@ local_install_deps( \arguments{ \item{root}{Path to the package tree.} -\item{lib}{Package library to install the packages to. Note that \emph{all} +\item{lib}{Package library to install the packages to. Note that _all_ dependent packages will be installed here, even if they are already installed in another library. The only exceptions are base -and recommended packages installed in \code{.Library}. These are not -duplicated in \code{lib}, unless a newer version of a recommemded package +and recommended packages installed in `.Library`. These are not +duplicated in `lib`, unless a newer version of a recommemded package is needed.} -\item{upgrade}{When \code{FALSE}, the default, pak does the minimum amount -of work to give you the latest version(s) of \code{pkg}. It will only upgrade -dependent packages if \code{pkg}, or one of their dependencies explicitly -require a higher version than what you currently have. It will also -prefer a binary package over to source package, even it the binary -package is older. +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. -When \code{upgrade = TRUE}, pak will ensure that you have the latest -version(s) of \code{pkg} and all their dependencies.} + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} \item{ask}{Whether to ask for confirmation when installing a different version of a package that is already installed. Installations that only @@ -38,15 +38,13 @@ add new packages never require confirmation.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ Data frame, with information about the installed package(s). @@ -56,9 +54,9 @@ Installs the hard dependencies of a package tree (or source package file), without installing the package tree itself. } \details{ -Note that development (and optional) dependencies, under \code{Suggests} in -\code{DESCRIPTION}, are not installed. If you want to install them as well, -use \code{\link[=local_install_dev_deps]{local_install_dev_deps()}}. +Note that development (and optional) dependencies, under `Suggests` in +`DESCRIPTION`, are not installed. If you want to install them as well, +use [local_install_dev_deps()]. } \seealso{ Other local package trees: diff --git a/man/local_install_dev_deps.Rd b/man/local_install_dev_deps.Rd index f74333c25..5e08363c1 100644 --- a/man/local_install_dev_deps.Rd +++ b/man/local_install_dev_deps.Rd @@ -15,22 +15,22 @@ local_install_dev_deps( \arguments{ \item{root}{Path to the package tree.} -\item{lib}{Package library to install the packages to. Note that \emph{all} +\item{lib}{Package library to install the packages to. Note that _all_ dependent packages will be installed here, even if they are already installed in another library. The only exceptions are base -and recommended packages installed in \code{.Library}. These are not -duplicated in \code{lib}, unless a newer version of a recommemded package +and recommended packages installed in `.Library`. These are not +duplicated in `lib`, unless a newer version of a recommemded package is needed.} -\item{upgrade}{When \code{FALSE}, the default, pak does the minimum amount -of work to give you the latest version(s) of \code{pkg}. It will only upgrade -dependent packages if \code{pkg}, or one of their dependencies explicitly -require a higher version than what you currently have. It will also -prefer a binary package over to source package, even it the binary -package is older. +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. -When \code{upgrade = TRUE}, pak will ensure that you have the latest -version(s) of \code{pkg} and all their dependencies.} + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} \item{ask}{Whether to ask for confirmation when installing a different version of a package that is already installed. Installations that only @@ -38,21 +38,19 @@ add new packages never require confirmation.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \description{ Installs all dependencies of a package tree (or source package file), without installing the package tree itself. It installs the development -dependencies as well, specified in the \code{Suggests} field of -\code{DESCRIPTION}. +dependencies as well, specified in the `Suggests` field of +`DESCRIPTION`. } \seealso{ Other local package trees: diff --git a/man/local_package_trees.Rd b/man/local_package_trees.Rd index 8a66ec443..ed3d86c1f 100644 --- a/man/local_package_trees.Rd +++ b/man/local_package_trees.Rd @@ -6,19 +6,17 @@ \description{ pak can install packages from local package trees. This is convenient for package development. See the following functions: -\itemize{ -\item \code{\link[=local_install]{local_install()}} installs a package from a package tree and all of its -dependencies. -\item \code{\link[=local_install_deps]{local_install_deps()}} installs all hard dependencies of a package. -\item \code{\link[=local_install_dev_deps]{local_install_dev_deps()}} installs all hard and soft dependencies -of a package. This function is intended for package development. -} +* [local_install()] installs a package from a package tree and all of its + dependencies. +* [local_install_deps()] installs all hard dependencies of a package. +* [local_install_dev_deps()] installs all hard and soft dependencies + of a package. This function is intended for package development. } \details{ Note that the last two functions do not install the package in the specified package tree itself, only its dependencies. This is convenient if the package itself is loaded via some other means, e.g. -\code{devtools::load_all()}, for development. +`devtools::load_all()`, for development. } \seealso{ Other local package trees: diff --git a/man/local_system_requirements.Rd b/man/local_system_requirements.Rd index c5514b382..76373594f 100644 --- a/man/local_system_requirements.Rd +++ b/man/local_system_requirements.Rd @@ -25,34 +25,34 @@ pkg_system_requirements( } \arguments{ \item{os, os_release}{The operating system and operating system release -version, e.g. "ubuntu", "debian", "centos", "redhat". See -\url{https://github.com/rstudio/r-system-requirements#operating-systems} for -all full list of supported operating systems. + version, e.g. "ubuntu", "debian", "centos", "redhat". See + for + all full list of supported operating systems. -If \code{NULL}, the default, these will be looked up using \code{\link[distro:distro]{distro::distro()}}.} + If `NULL`, the default, these will be looked up using [distro::distro()].} \item{root}{Path to the package tree.} -\item{execute, sudo}{If \code{execute} is \code{TRUE}, pak will execute the system -commands (if any). If \code{sudo} is \code{TRUE}, pak will prepend the commands with -\href{https://en.wikipedia.org/wiki/Sudo}{sudo}.} +\item{execute, sudo}{If `execute` is `TRUE`, pak will execute the system +commands (if any). If `sudo` is `TRUE`, pak will prepend the commands with +[sudo](https://en.wikipedia.org/wiki/Sudo).} -\item{echo}{If \code{echo} is \code{TRUE} and \code{execute} is \code{TRUE}, echo the command output.} +\item{echo}{If `echo` is `TRUE` and `execute` is `TRUE`, echo the command output.} \item{package}{Package names to lookup system requirements for.} } \value{ A character vector of commands needed to install the system -requirements for the package. + requirements for the package. } \description{ Returns a character vector of commands to run that will install system requirements for the queried operating system. -\code{local_system_requirements()} queries system requirements for a dev package -(and its dependencies) given its \code{root} path. +`local_system_requirements()` queries system requirements for a dev package +(and its dependencies) given its `root` path. -\code{pkg_system_requirements()} queries system requirements for existing packages +`pkg_system_requirements()` queries system requirements for existing packages (and their dependencies). } \examples{ diff --git a/man/lockfile_create.Rd b/man/lockfile_create.Rd index c75bf73c8..f70ebe1cb 100644 --- a/man/lockfile_create.Rd +++ b/man/lockfile_create.Rd @@ -14,56 +14,52 @@ lockfile_create( } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} \item{lockfile}{Path to the lock file.} -\item{lib}{Package library to install the packages to. Note that \emph{all} +\item{lib}{Package library to install the packages to. Note that _all_ dependent packages will be installed here, even if they are already installed in another library. The only exceptions are base -and recommended packages installed in \code{.Library}. These are not -duplicated in \code{lib}, unless a newer version of a recommemded package +and recommended packages installed in `.Library`. These are not +duplicated in `lib`, unless a newer version of a recommemded package is needed.} -\item{upgrade}{When \code{FALSE}, the default, pak does the minimum amount -of work to give you the latest version(s) of \code{pkg}. It will only upgrade -dependent packages if \code{pkg}, or one of their dependencies explicitly -require a higher version than what you currently have. It will also -prefer a binary package over to source package, even it the binary -package is older. +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. -When \code{upgrade = TRUE}, pak will ensure that you have the latest -version(s) of \code{pkg} and all their dependencies.} + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \description{ The lock file can be used later, possibly in a new R session, to carry out the installation of the dependencies, with -\code{\link[=lockfile_install]{lockfile_install()}}. +[lockfile_install()]. } \details{ Note, since the URLs of CRAN and most CRAN-like repositories change -over time, in practice you cannot use the lock file \emph{much} later. +over time, in practice you cannot use the lock file _much_ later. For example, binary packages of older package version might be deleted from the repository, breaking the URLs in the lock file. diff --git a/man/lockfile_install.Rd b/man/lockfile_install.Rd index 3b34b39ff..18a796e22 100644 --- a/man/lockfile_install.Rd +++ b/man/lockfile_install.Rd @@ -12,11 +12,11 @@ lockfile_install(lockfile = "pkg.lock", lib = .libPaths()[1], update = TRUE) \item{lib}{Library to carry out the installation on.} \item{update}{Whether to online install the packages that -either not installed in \code{lib}, or a different version is installed +either not installed in `lib`, or a different version is installed for them.} } \description{ -Install a lock file that was created with \code{\link[=lockfile_create]{lockfile_create()}}. +Install a lock file that was created with [lockfile_create()]. } \seealso{ Other lock files: diff --git a/man/metadata.Rd b/man/metadata.Rd index 779824c68..d4c763670 100644 --- a/man/metadata.Rd +++ b/man/metadata.Rd @@ -16,150 +16,73 @@ meta_update() meta_clean(force = FALSE) } \arguments{ -\item{pkg}{Package names, if specified then only entries for \code{pkg} +\item{pkg}{Package names, if specified then only entries for `pkg` are returned.} -\item{force}{If \code{FALSE}, then pak will ask for confirmation.} +\item{force}{If `FALSE`, then pak will ask for confirmation.} } \value{ -\code{meta_summary()} returns a list with entries: -\itemize{ -\item \code{cachepath}: absolute path of the metadata cache. -\item \code{current_db}: the file that contains the current metadata database. -It is currently an RDS file, but this might change in the future. -\item \code{raw_files}: the files that are the downloaded \verb{PACKAGES*} files. -\item \code{db_files}: all metadata database files. -\item \code{size}: total size of the metadata cache. -} - -\code{meta_list()} returns a data frame of all available +`meta_summary()` returns a list with entries: +* `cachepath`: absolute path of the metadata cache. +* `current_db`: the file that contains the current metadata database. + It is currently an RDS file, but this might change in the future. +* `raw_files`: the files that are the downloaded `PACKAGES*` files. +* `db_files`: all metadata database files. +* `size`: total size of the metadata cache. + +`meta_list()` returns a data frame of all available packages in the configured repositories. -\code{meta_update()} returns nothing. +`meta_update()` returns nothing. -\code{meta_clean()} returns nothing +`meta_clean()` returns nothing } \description{ Various utilities to inspect, update and clean the metadata cache. See the pkgcache package if you need for control over the metadata cache. } \details{ -\code{meta_summary()} returns a summary of the metadata cache. +`meta_summary()` returns a summary of the metadata cache. -\code{meta_list()} lists all (or some) packages in the metadata +`meta_list()` lists all (or some) packages in the metadata database. -\code{meta_update()} updates the metadata database. You don't +`meta_update()` updates the metadata database. You don't normally need to call this function manually, because all pak functions -(e.g. \code{\link[=pkg_install]{pkg_install()}}, \code{\link[=pkg_download]{pkg_download()}}, etc.) call it automatically, +(e.g. [pkg_install()], [pkg_download()], etc.) call it automatically, to make sure that they use the latest available metadata. -\code{meta_clean()} deletes the whole metadata DB. +`meta_clean()` deletes the whole metadata DB. } \section{Examples}{ Metadata cache summary: -\if{html}{\out{
}}\preformatted{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-34444e3072.rds" -#> -#> $raw_files -#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCann-59693086a0/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES.gz" -#> [2] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCann-59693086a0/src/contrib/PACKAGES.gz" -#> [3] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCexp-90d4a3978b/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES.gz" -#> [4] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCexp-90d4a3978b/src/contrib/PACKAGES.gz" -#> [5] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCsoft-2a43920999/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES.gz" -#> [6] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCsoft-2a43920999/src/contrib/PACKAGES.gz" -#> [7] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCworkflows-26330ba3ca/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES.gz" -#> [8] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/BioCworkflows-26330ba3ca/src/contrib/PACKAGES.gz" -#> [9] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/CRAN-075c426938/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES.gz" -#> [10] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/CRAN-075c426938/src/contrib/PACKAGES.gz" -#> -#> $db_files -#> [1] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/pkgs-34444e3072.rds" -#> [2] "/Users/gaborcsardi/Library/Caches/org.R-project.R/R/pkgcache/_metadata/pkgs-ccacf1b389.rds" -#> -#> $size -#> [1] 174848200 -}\if{html}{\out{
}} +```{r meta-summary} +meta_summary() +``` The current metadata DB: - -\if{html}{\out{
}}\preformatted{meta_list() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Loading metadata database ... done                                    
-#> # A data frame: 45,279 × 32                                             
-#>    package version depends sugge…¹ license imports linki…² archs enhan…³
-#>    <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr> <chr>  
-#>  1 A3      1.0.0   R (>= … random… GPL (>… NA      NA      NA    NA     
-#>  2 AATtoo… 0.0.2   R (>= … NA      GPL-3   magrit… NA      NA    NA     
-#>  3 ABACUS  1.0.0   R (>= … rmarkd… GPL-3   ggplot… NA      NA    NA     
-#>  4 ABC.RAP 0.9.0   R (>= … knitr,… GPL-3   graphi… NA      NA    NA     
-#>  5 ABCana… 1.2.1   R (>= … NA      GPL-3   plotrix NA      NA    NA     
-#>  6 ABCopt… 0.15.0  NA      testth… MIT + … Rcpp, … Rcpp    ABCo… NA     
-#>  7 ABCp2   1.2     MASS    NA      GPL-2   NA      NA      NA    NA     
-#>  8 ABHgen… 1.0.1   NA      knitr,… GPL-3   ggplot… NA      NA    NA     
-#>  9 ABPS    0.3     NA      testth… GPL (>… kernlab NA      NA    NA     
-#> 10 ACA     1.1     R (>= … NA      GPL     graphi… NA      NA    NA     
-#> # … with 45,269 more rows, 23 more variables:                           
-#> #   license_restricts_use <chr>, os_type <chr>, priority <chr>,         
-#> #   license_is_foss <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>, …         
-
-}} - +```{asciicast meta-list} +meta_list() +``` Selected packages only: - -\if{html}{\out{
}}\preformatted{meta_list(pkg = c("shiny", "htmlwidgets")) -}\if{html}{\out{
}}\if{html}{\out{ -
-#>   package  version depends sugge…¹ license imports linki…² archs enhan…³
-#> * <chr>    <chr>   <chr>   <chr>   <chr>   <chr>   <chr>   <chr> <chr>  
-#> 1 htmlwid… 1.5.4   NA      "knitr… MIT + … "grDev… NA      NA    shiny …
-#> 2 shiny    1.7.3   R (>= … "datas… GPL-3 … "utils… NA      NA    NA     
-#> 3 htmlwid… 1.6.0   NA      "testt… MIT + … "grDev… NA      NA    shiny …
-#> 4 shiny    1.7.4   R (>= … "datas… GPL-3 … "utils… NA      NA    NA     
-#> # … with 23 more variables: license_restricts_use <chr>, os_type <chr>, 
-#> #   priority <chr>, license_is_foss <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, 
-#>                                                                        
-
-}} +```{asciicast meta-list-2} +meta_list(pkg = c("shiny", "htmlwidgets")) +``` Update the metadata DB - -\if{html}{\out{
}}\preformatted{meta_update() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Updated metadata database: 1.23 MB in 1 file.                         
-#>  Updating metadata database ... done                                   
-
-}} +```{asciicast meta-update} +meta_update() +``` Delete the metadata DB - -\if{html}{\out{
}}\preformatted{meta_clean() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Cleaning up cache directory /Users/gaborcsardi/Library/Caches/org.R-pr
-#> oject.R/R/pkgcache/_metadata.                                           
-
-}} +```{asciicast meta-clean} +meta_clean() +``` } diff --git a/man/pak-config.Rd b/man/pak-config.Rd index 1d91ffa3e..05124b4c9 100644 --- a/man/pak-config.Rd +++ b/man/pak-config.Rd @@ -6,49 +6,47 @@ \title{Environment variables and options that modify the default behavior} \description{ pak behavior can be finetuned with environment variables and -options (as in \code{\link[base:options]{base::options()}}). +options (as in [base::options()]). } -\section{R options affecting pak's behavior}{ -\subsection{\code{Ncpus}}{ +\details{ +# R options affecting pak's behavior + +## `Ncpus` Set to the desired number of worker processes for package installation. If not set, then pak will use the number of logical processors in the machine. -} -\subsection{\code{repos}}{ +## `repos` -The CRAN-like repositories to use. See \code{\link[base:options]{base::options()}} for details. -} -} +The CRAN-like repositories to use. See [base::options()] for details. + +# pak configuration -\section{pak configuration}{ Configuration entries (unless noted otherwise on this manual page) have a corresponding environment variable, and a corresponding option. The environment variable is always uppercase and uses underscores as the -word separator. It always has the \code{PKG_} prefix. +word separator. It always has the `PKG_` prefix. The option is typically lowercase, use it uses underscores as the word -separator, but it always has the \code{pkg.} prefix (notice the dot!). +separator, but it always has the `pkg.` prefix (notice the dot!). -Some examples:\tabular{lll}{ - Config entry name \tab Env var name \tab Option name \cr - platforms \tab \code{PKG_PLATFORMS} \tab \code{pkg.platforms} \cr - cran_mirror \tab \code{PKG_CRAN_MIRROR} \tab \code{pkg.cran_mirror} \cr -} +Some examples: + +| Config entry name | Env var name | Option name | +|:-------------------|:------------------|:------------------| +| platforms | `PKG_PLATFORMS` | `pkg.platforms` | +| cran_mirror | `PKG_CRAN_MIRROR` | `pkg.cran_mirror` | -\subsection{pak configuration entries}{ +## pak configuration entries \eval{doc_config()} -} -\subsection{Notes}{ +## Notes -From version 0.4.0 pak copies the \verb{PKG_*} environment variables and -the \verb{pkg.*} options to the pak subprocess, where they are actually +From version 0.4.0 pak copies the `PKG_*` environment variables and +the `pkg.*` options to the pak subprocess, where they are actually used, so you don't need to restart R or reaload pak after a configuration change. } -} - diff --git a/man/pak.Rd b/man/pak.Rd index 72a99e75e..b4f317785 100644 --- a/man/pak.Rd +++ b/man/pak.Rd @@ -8,11 +8,11 @@ pak(pkg = NULL, ...) } \arguments{ \item{pkg}{Package names or remote package specifications to install. -See \link[=Package sources]{pak package sources} for details. If \code{NULL}, +See [pak package sources][Package sources] for details. If `NULL`, will install all development dependencies for the current package.} -\item{...}{Extra arguments are passed to \code{\link[=pkg_install]{pkg_install()}} or -\code{\link[=local_install_dev_deps]{local_install_dev_deps()}}.} +\item{...}{Extra arguments are passed to [pkg_install()] or +[local_install_dev_deps()].} } \description{ Install the specified packages, or the ones required by @@ -20,15 +20,13 @@ the package or project in the current working directory. } \details{ This is a convenience function: -\itemize{ -\item If you want to install some packages, it is easier to type -than \code{\link[=pkg_install]{pkg_install()}}. -\item If you want to install all the packages that are needed -for the development of a package or project, then it is -easier to type than \code{\link[=local_install_dev_deps]{local_install_dev_deps()}}. -\item You don't need to remember two functions to install -packages, just one. -} +* If you want to install some packages, it is easier to type + than [pak::pkg_install()]. +* If you want to install all the packages that are needed + for the development of a package or project, then it is + easier to type than [pak::local_install_dev_deps()]. +* You don't need to remember two functions to install + packages, just one. } \seealso{ Other package functions: @@ -37,6 +35,7 @@ Other package functions: \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} diff --git a/man/pak_cleanup.Rd b/man/pak_cleanup.Rd index 02d6c9ecc..4b806dcae 100644 --- a/man/pak_cleanup.Rd +++ b/man/pak_cleanup.Rd @@ -20,7 +20,7 @@ data.} \item{pak_lib}{This argument is now deprecated and does nothing.} \item{force}{Do not ask for confirmation. Note that to use this function -in non-interactive mode, you have to specify \code{force = TRUE}.} +in non-interactive mode, you have to specify `force = TRUE`.} } \description{ Clean up pak caches diff --git a/man/pak_install_extra.Rd b/man/pak_install_extra.Rd index 21a242618..efe9e9584 100644 --- a/man/pak_install_extra.Rd +++ b/man/pak_install_extra.Rd @@ -17,5 +17,5 @@ used with these packages. E.g. many functions return data frames, which print nicer when the pillar package is available. } \details{ -Currently only one package is optional: \strong{pillar}. +Currently only one package is optional: **pillar**. } diff --git a/man/pak_package_sources.Rd b/man/pak_package_sources.Rd index c41bfcd6b..07b3910d3 100644 --- a/man/pak_package_sources.Rd +++ b/man/pak_package_sources.Rd @@ -9,7 +9,7 @@ Learn how to tell pak which packages to install, and where those packages can be found. If you want a quick overview of package sources, see -"\link{Get started with pak}". +"[Get started with pak]". } \details{ \eval{include_docs("pkgdepends", "docs/pkg-refs.rds", top = FALSE)} diff --git a/man/pak_setup.Rd b/man/pak_setup.Rd index 0c107388e..07f49de5d 100644 --- a/man/pak_setup.Rd +++ b/man/pak_setup.Rd @@ -19,5 +19,5 @@ The path to the private library, invisibly. } \description{ This function is deprecated and does nothing. -Recent versions of pak do not need a \code{pak_setup()} call. +Recent versions of pak do not need a `pak_setup()` call. } diff --git a/man/pak_sitrep.Rd b/man/pak_sitrep.Rd index 933f9c94e..c661d05f1 100644 --- a/man/pak_sitrep.Rd +++ b/man/pak_sitrep.Rd @@ -9,38 +9,17 @@ pak_sitrep() } \description{ It prints -\itemize{ -\item pak version, -\item the current library path, -\item location of the private library, -\item whether the pak private library exists, -\item whether the pak private library is functional. -} +* pak version, +* the current library path, +* location of the private library, +* whether the pak private library exists, +* whether the pak private library is functional. } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{pak_sitrep() -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  compatible)                                                            
-#> - pak repository: - (local install?)                                    
-#> * Optional packages installed:                                          
-#> - pillar                                                                
-#> * Library path:                                                         
-#> - /private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpcpVAdU/fi
-#> led8ef3d7a46fc                                                          
-#> - /private/var/folders/ph/fpcmzfd16rgbbk8mxvy9m2_h0000gn/T/RtmpcpVAdU/fi
-#> led8ef2562d6ef                                                          
-#> - /Users/gaborcsardi/Library/R/arm64/4.2/library                        
-#> - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library  
-#> * Private library location:                                             
-#> - /Users/gaborcsardi/Library/Caches/org.R-project.R/R/pak/lib/4.2/aarch6
-#> 4                                                                       
-#> * Private library exists.                                               
-#> * Private library is functional                                         
-
-}} +```{asciicast pak-sitrep} +pak_sitrep() +``` } \seealso{ diff --git a/man/pak_solver.Rd b/man/pak_solver.Rd index feec47faf..e40497660 100644 --- a/man/pak_solver.Rd +++ b/man/pak_solver.Rd @@ -13,37 +13,37 @@ however, this is not the case. } \details{ Here is an example of a conflict detected: - -\if{html}{\out{
}}\preformatted{> pak::pkg_install(c("r-lib/pkgcache@conflict", "r-lib/cli@message")) +``` +> pak::pkg_install(c("r-lib/pkgcache@conflict", "r-lib/cli@message")) Error: Cannot install packages: * Cannot install `r-lib/pkgcache@conflict`. - Cannot install dependency r-lib/cli@main * Cannot install `r-lib/cli@main`. - Conflicts r-lib/cli@message -}\if{html}{\out{
}} +``` -\code{r-lib/pkgcache@conflict} depends on the main branch of \code{r-lib/cli}, -whereas, we explicitly requested the \code{message} branch. Since it cannot +`r-lib/pkgcache@conflict` depends on the main branch of `r-lib/cli`, +whereas, we explicitly requested the `message` branch. Since it cannot install both versions into a single library, pak quits. When pak considers a package for installation, and the package is given with its name only, (e.g. as a dependency of another package), then -the package may have \emph{any} package source. This is necessary, because +the package may have _any_ package source. This is necessary, because one R package library may contain only at most one version of a package with a given name. pak's behavior is best explained via an example. Assume that you are installing a local package (see below), e.g. -\code{local::.}, and the local package depends on \code{pkgA} and \code{user/pkgB}, -the latter being a package from GitHub (see below), and that \code{pkgA} -also depends on \code{pkgB}. Now pak must install \code{pkgB} \emph{and} \code{user/pkgB}. -In this case pak interprets \code{pkgB} as a package from any package source, -instead of a standard package, so installing \code{user/pkgB} satisfies both +`local::.`, and the local package depends on `pkgA` and `user/pkgB`, +the latter being a package from GitHub (see below), and that `pkgA` +also depends on `pkgB`. Now pak must install `pkgB` _and_ `user/pkgB`. +In this case pak interprets `pkgB` as a package from any package source, +instead of a standard package, so installing `user/pkgB` satisfies both requirements. -Note that that \code{cran::pkgB} and \code{user/pkgB} requirements result a -conflict that pak cannot resolve. This is because the first one \emph{must} -be a CRAN package, and the second one \emph{must} be a GitHub package, and +Note that that `cran::pkgB` and `user/pkgB` requirements result a +conflict that pak cannot resolve. This is because the first one _must_ +be a CRAN package, and the second one _must_ be a GitHub package, and two different packages with the same cannot be installed into an R package library. } diff --git a/man/pak_update.Rd b/man/pak_update.Rd index ab3ad9618..199b92967 100644 --- a/man/pak_update.Rd +++ b/man/pak_update.Rd @@ -11,15 +11,13 @@ pak_update(force = FALSE, stream = c("auto", "stable", "rc", "devel")) available.} \item{stream}{Whether to update to the -\itemize{ -\item \code{"stable"}, -\item \code{"rc"} (release candidate) or -\item \code{"devel"} (development) version. -\item \code{"auto"} updates to the same stream as the current one. -} + * `"stable"`, + * `"rc"` (release candidate) or + * `"devel"` (development) version. + * `"auto"` updates to the same stream as the current one. -Often there is no release candidate version, then \code{"rc"} also -installs the stable version.} + Often there is no release candidate version, then `"rc"` also + installs the stable version.} } \value{ Nothing. diff --git a/man/pkg_deps.Rd b/man/pkg_deps.Rd index 8ea02a005..5d63f23b4 100644 --- a/man/pkg_deps.Rd +++ b/man/pkg_deps.Rd @@ -8,97 +8,46 @@ pkg_deps(pkg, upgrade = TRUE, dependencies = NA) } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} \item{upgrade}{Whether to use the most recent available package versions.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ -A data frame with the dependency data, it includes \code{pkg} -as well. It has the following columns. -\eval{include_docs("pkgdepends", "docs/resolution-result.rds")} +A data frame with the dependency data, it includes `pkg` + as well. It has the following columns. + \eval{include_docs("pkgdepends", "docs/resolution-result.rds")} } \description{ Look up the dependencies of a package } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{pkg_deps("dplyr") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 16 × 32                                                 
-#>    ref       type  direct direc…¹ status package version license needs…²
-#>    <chr>     <chr> <lgl>  <lgl>   <chr>  <chr>   <chr>   <chr>   <lgl>  
-#>  1 R6        stan… FALSE  FALSE   OK     R6      2.5.1   MIT + … FALSE  
-#>  2 cli       stan… FALSE  FALSE   OK     cli     3.4.1   MIT + … FALSE  
-#>  3 dplyr     stan… TRUE   TRUE    OK     dplyr   1.0.10  MIT + … FALSE  
-#>  4 fansi     stan… FALSE  FALSE   OK     fansi   1.0.3   GPL-2 … FALSE  
-#>  5 generics  stan… FALSE  FALSE   OK     generi… 0.1.3   MIT + … FALSE  
-#>  6 glue      stan… FALSE  FALSE   OK     glue    1.6.2   MIT + … FALSE  
-#>  7 lifecycle stan… FALSE  FALSE   OK     lifecy… 1.0.3   MIT + … FALSE  
-#>  8 magrittr  stan… FALSE  FALSE   OK     magrit… 2.0.3   MIT + … FALSE  
-#>  9 pillar    stan… FALSE  FALSE   OK     pillar  1.8.1   MIT + … FALSE  
-#> 10 pkgconfig stan… FALSE  FALSE   OK     pkgcon… 2.0.3   MIT + … FALSE  
-#> 11 rlang     stan… FALSE  FALSE   OK     rlang   1.0.6   MIT + … FALSE  
-#> 12 tibble    stan… FALSE  FALSE   OK     tibble  3.1.8   MIT + … FALSE  
-#> 13 tidysele… stan… FALSE  FALSE   OK     tidyse… 1.2.0   MIT + … FALSE  
-#> 14 utf8      stan… FALSE  FALSE   OK     utf8    1.2.2   Apache… FALSE  
-#> 15 vctrs     stan… FALSE  FALSE   OK     vctrs   0.5.1   MIT + … FALSE  
-#> 16 withr     stan… FALSE  FALSE   OK     withr   2.5.0   MIT + … FALSE  
-#> # … with 23 more variables: priority <chr>, 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, …    
-
-}} - +```{asciicast pkg-deps} +pkg_deps("dplyr") +``` For a package on GitHub: - -\if{html}{\out{
}}\preformatted{pkg_deps("r-lib/callr") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 4 × 32                                                  
-#>   ref        type  direct direc…¹ status package version license needs…²
-#>   <chr>      <chr> <lgl>  <lgl>   <chr>  <chr>   <chr>   <chr>   <lgl>  
-#> 1 r-lib/cal… gith… TRUE   TRUE    OK     callr   3.7.3.… MIT + … TRUE   
-#> 2 R6         stan… FALSE  FALSE   OK     R6      2.5.1   MIT + … FALSE  
-#> 3 processx   stan… FALSE  FALSE   OK     proces… 3.8.0   MIT + … FALSE  
-#> 4 ps         stan… FALSE  FALSE   OK     ps      1.7.2   MIT + … FALSE  
-#> # … with 23 more variables: priority <chr>, 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, …    
-
-}} +```{asciicast pkg-deps-gh} +pkg_deps("r-lib/callr") +``` } \seealso{ @@ -108,6 +57,7 @@ Other package functions: \code{\link{pkg_deps_tree}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} diff --git a/man/pkg_deps_explain.Rd b/man/pkg_deps_explain.Rd index 0c6844a99..510b004b4 100644 --- a/man/pkg_deps_explain.Rd +++ b/man/pkg_deps_explain.Rd @@ -8,16 +8,14 @@ pkg_deps_explain(pkg, deps, upgrade = TRUE, dependencies = NA) } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} \item{deps}{Package names of the dependencies to explain.} @@ -26,74 +24,37 @@ versions.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ A named list with a print method. First entries are the -function arguments: \code{pkg}, \code{deps}, \code{dependencies}, the last one is -\code{paths} and it contains the results in a named list, the names are -the package names in \code{deps}. + function arguments: `pkg`, `deps`, `dependencies`, the last one is + `paths` and it contains the results in a named list, the names are + the package names in `deps`. } \description{ -Extract dependency chains from \code{pkg} to \code{deps}. +Extract dependency chains from `pkg` to `deps`. } \details{ -This function is similar to \code{\link[=pkg_deps_tree]{pkg_deps_tree()}}, but its output is easier -to read if you are only interested is certain packages (\code{deps}). +This function is similar to [pkg_deps_tree()], but its output is easier +to read if you are only interested is certain packages (`deps`). } \section{Examples}{ How does dplyr depend on rlang? - -\if{html}{\out{
}}\preformatted{pkg_deps_explain("dplyr", "rlang") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Updated metadata database: 5.09 MB in 12 files.                       
-#>  Updating metadata database ... done                                   
-#> dplyr -> lifecycle -> rlang                                             
-#> dplyr -> rlang                                                          
-#> dplyr -> tibble -> lifecycle -> rlang                                   
-#> dplyr -> tibble -> pillar -> lifecycle -> rlang                         
-#> dplyr -> tibble -> pillar -> rlang                                      
-#> dplyr -> tibble -> pillar -> vctrs -> lifecycle -> rlang                
-#> dplyr -> tibble -> pillar -> vctrs -> rlang                             
-#> dplyr -> tibble -> rlang                                                
-#> dplyr -> tibble -> vctrs -> lifecycle -> rlang                          
-#> dplyr -> tibble -> vctrs -> rlang                                       
-#> dplyr -> tidyselect -> lifecycle -> rlang                               
-#> dplyr -> tidyselect -> rlang                                            
-#> dplyr -> tidyselect -> vctrs -> lifecycle -> rlang                      
-#> dplyr -> tidyselect -> vctrs -> rlang                                   
-#> dplyr -> vctrs -> lifecycle -> rlang                                    
-#> dplyr -> vctrs -> rlang                                                 
-#> dplyr -> pillar -> lifecycle -> rlang                                   
-#> dplyr -> pillar -> rlang                                                
-#> dplyr -> pillar -> vctrs -> lifecycle -> rlang                          
-#> dplyr -> pillar -> vctrs -> rlang                                       
-
-}} - +```{asciicast pkg-deps-explain} +pkg_deps_explain("dplyr", "rlang") +``` How does the GH version of usethis depend on cli and ps? - -\if{html}{\out{
}}\preformatted{pkg_deps_explain("r-lib/usethis", c("cli", "ps")) -}\if{html}{\out{
}}\if{html}{\out{ -
-#> usethis -> cli                                                          
-#> usethis -> desc -> cli                                                  
-#> usethis -> gh -> cli                                                    
-#> usethis -> lifecycle -> cli                                             
-#>                                                                         
-#> x ps                                                                    
-
-}} +```{asciicast pkg-deps-explain-2} +pkg_deps_explain("r-lib/usethis", c("cli", "ps")) +``` } diff --git a/man/pkg_deps_tree.Rd b/man/pkg_deps_tree.Rd index 467b6281a..983689487 100644 --- a/man/pkg_deps_tree.Rd +++ b/man/pkg_deps_tree.Rd @@ -8,146 +8,43 @@ pkg_deps_tree(pkg, upgrade = TRUE, dependencies = NA) } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} \item{upgrade}{Whether to use the most recent available package versions.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ -The same data frame as \code{\link[=pkg_deps]{pkg_deps()}}, invisibly. +The same data frame as [pkg_deps()], invisibly. } \description{ Draw the dependency tree of a package } \section{Examples}{ +```{asciicast pkg-deos-tree} +pkg_deps_tree("dplyr") +``` -\if{html}{\out{
}}\preformatted{pkg_deps_tree("dplyr") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> dplyr 1.0.10                                                           
-#> ├─generics 0.1.3                                                       
-#> ├─glue 1.6.2                                                           
-#> ├─lifecycle 1.0.3                                                      
-#> │ ├─cli 3.4.1                                                          
-#> │ ├─glue                                                                
-#> │ └─rlang 1.0.6                                                        
-#> ├─magrittr 2.0.3                                                       
-#> ├─R6 2.5.1                                                             
-#> ├─rlang                                                                 
-#> ├─tibble 3.1.8                                                         
-#> │ ├─fansi 1.0.3                                                        
-#> │ ├─lifecycle                                                           
-#> │ ├─magrittr                                                            
-#> │ ├─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                                                               
-#> ├─tidyselect 1.2.0                                                     
-#> │ ├─cli                                                                 
-#> │ ├─glue                                                                
-#> │ ├─lifecycle                                                           
-#> │ ├─rlang                                                               
-#> │ ├─vctrs                                                               
-#> │ └─withr 2.5.0                                                        
-#> ├─vctrs                                                                 
-#> └─pillar                                                                
-#>                                                                         
-#> Key:   new                                                             
-
-}} - - -\if{html}{\out{
}}\preformatted{pkg_deps_tree("r-lib/usethis") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> r-lib/usethis 2.1.6.9000 ✨👷🏼🔧                                           
-#> ├─cli 3.4.1                                                            
-#> ├─clipr 0.8.0                                                          
-#> ├─crayon 1.5.2                                                         
-#> ├─curl 4.3.3                                                           
-#> ├─desc 1.4.2                                                           
-#> │ ├─cli                                                                 
-#> │ ├─R6 2.5.1                                                           
-#> │ └─rprojroot 2.0.3                                                    
-#> ├─fs 1.5.2                                                             
-#> ├─gert 1.9.2 ✨ ⬇ (1.91 MB)                                              
-#> │ ├─askpass 1.1                                                        
-#> │ │ └─sys 3.4.1                                                        
-#> │ ├─credentials 1.3.2 ✨ ⬇ (170.15 kB)                                   
-#> │ │ ├─openssl 2.0.5                                                    
-#> │ │ │ └─askpass                                                         
-#> │ │ ├─sys                                                               
-#> │ │ ├─curl                                                              
-#> │ │ ├─jsonlite 1.8.4                                                   
-#> │ │ └─askpass                                                           
-#> │ ├─openssl                                                             
-#> │ ├─rstudioapi 0.14                                                    
-#> │ ├─sys                                                                 
-#> │ └─zip 2.2.2                                                          
-#> ├─gh 1.3.1 ✨ ⬇ (95.20 kB)                                               
-#> │ ├─cli                                                                 
-#> │ ├─gitcreds 0.1.2 ✨ ⬇ (95.59 kB)                                       
-#> │ ├─httr 1.4.4                                                         
-#> │ │ ├─curl                                                              
-#> │ │ ├─jsonlite                                                          
-#> │ │ ├─mime 0.12                                                        
-#> │ │ ├─openssl                                                           
-#> │ │ └─R6                                                                
-#> │ ├─ini 0.3.1 ✨ ⬇ (13.13 kB)                                            
-#> │ └─jsonlite                                                            
-#> ├─glue 1.6.2                                                           
-#> ├─jsonlite                                                              
-#> ├─lifecycle 1.0.3                                                      
-#> │ ├─cli                                                                 
-#> │ ├─glue                                                                
-#> │ └─rlang 1.0.6                                                        
-#> ├─purrr 0.3.5                                                          
-#> │ ├─magrittr 2.0.3                                                     
-#> │ └─rlang                                                               
-#> ├─rappdirs 0.3.3                                                       
-#> ├─rlang                                                                 
-#> ├─rprojroot                                                             
-#> ├─rstudioapi                                                            
-#> ├─whisker 0.4.1 ✨ ⬇ (65.36 kB)                                          
-#> ├─withr 2.5.0                                                          
-#> └─yaml 2.3.6                                                           
-#>                                                                         
-#> Key:   new |  download | 👷🏼 build | 🔧 compile                        
-
-}} +```{asciicast pkg-deps-tree-2} +pkg_deps_tree("r-lib/usethis") +``` } \seealso{ @@ -157,6 +54,7 @@ Other package functions: \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} diff --git a/man/pkg_download.Rd b/man/pkg_download.Rd index eb9bbfd80..852f955ed 100644 --- a/man/pkg_download.Rd +++ b/man/pkg_download.Rd @@ -14,34 +14,30 @@ pkg_download( } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} \item{dest_dir}{Destination directory for the packages. If it does not exist, then it will be created.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} \item{platforms}{Types of binary or source packages to download. The -default is the value of \code{\link[pkgdepends:default_platforms]{pkgdepends::default_platforms()}}.} +default is the value of [pkgdepends::default_platforms()].} \item{r_versions}{R version(s) to download packages for. (This does not matter for source packages, but it does for binaries.) It defaults to @@ -49,8 +45,8 @@ the current R version.} } \value{ Data frame with information about the downloaded -packages, invisibly. Columns: -\eval{include_docs("pkgdepends", "docs/download-result.rds")} + packages, invisibly. Columns: + \eval{include_docs("pkgdepends", "docs/download-result.rds")} } \description{ TODO: explain result @@ -58,48 +54,21 @@ TODO: explain result \section{Examples}{ -\if{html}{\out{
}}\preformatted{dl <- pkg_download("forcats") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  No downloads are needed, 2 pkgs (641.53 kB) are cached                
-
-}} - - -\if{html}{\out{
}}\preformatted{dl -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 2 × 35                                                  
-#>   ref     type     direct direc…¹ status package version license needs…²
-#>   <chr>   <chr>    <lgl>  <lgl>   <chr>  <chr>   <chr>   <chr>   <lgl>  
-#> 1 forcats standard TRUE   TRUE    OK     forcats 0.5.2   MIT + … FALSE  
-#> 2 forcats standard TRUE   TRUE    OK     forcats 0.5.2   MIT + … FALSE  
-#> # … with 26 more variables: priority <chr>, 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>, extra <list>, dep_types <list>, params <list>,     
-#> #   sysreqs <chr>, cache_status <chr>, fulltarget <chr>,                
-#> #   fulltarget_tree <chr>, download_status <chr>, …                     
-
-}} - +```{asciicast pkg-download} +dl <- pkg_download("forcats") +``` -\if{html}{\out{
}}\preformatted{dl$fulltarget -}\if{html}{\out{
}}\if{html}{\out{ -
-#> [1] "./bin/macosx/big-sur-arm64/contrib/4.2/forcats_0.5.2.tgz"          
-#> [2] "./src/contrib/forcats_0.5.2.tar.gz"                                
-
-}} +```{asciicast pkg-download-2} +dl +``` +```{asciicast pkg-download-3} +dl$fulltarget +``` -\if{html}{\out{
}}\preformatted{pkg_download("r-lib/pak", platforms = "source") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  No downloads are needed, 1 pkg is cached                              
-
-}} +```{asciicast pkg-download-4} +pkg_download("r-lib/pak", platforms = "source") +``` } \seealso{ @@ -109,6 +78,7 @@ Other package functions: \code{\link{pkg_deps_tree}()}, \code{\link{pkg_deps}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} diff --git a/man/pkg_history.Rd b/man/pkg_history.Rd index 902d269ac..365475351 100644 --- a/man/pkg_history.Rd +++ b/man/pkg_history.Rd @@ -11,39 +11,16 @@ pkg_history(pkg) } \value{ A data frame, with one row per package version. The columns are -the entries of the \code{DESCRIPTION} files in the released package -versions. + the entries of the `DESCRIPTION` files in the released package + versions. } \description{ Query the history of a CRAN package } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{pkg_history("ggplot2") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 44 × 30                                                 
-#>    Package Type    Title    Version Date  Author Maint…¹ Descr…² License
-#>  * <chr>   <chr>   <chr>    <chr>   <chr> <chr>  <chr>   <chr>   <chr>  
-#>  1 ggplot2 Package An impl… 0.5     2007… Hadle… Hadley… "An im… GPL    
-#>  2 ggplot2 Package An impl… 0.5.1   2007… Hadle… Hadley… "An im… GPL    
-#>  3 ggplot2 Package An impl… 0.5.2   2007… Hadle… Hadley… "An im… GPL    
-#>  4 ggplot2 Package An impl… 0.5.4   2007… Hadle… Hadley… "An im… GPL    
-#>  5 ggplot2 Package An impl… 0.5.5   2007… Hadle… Hadley… "An im… GPL    
-#>  6 ggplot2 Package An impl… 0.5.6   2007… Hadle… Hadley… "An im… GPL    
-#>  7 ggplot2 Package An impl… 0.5.7   2007… Hadle… Hadley… "An im… GPL    
-#>  8 ggplot2 Package An impl… 0.6     2008… Hadle… Hadley… "An im… GPL    
-#>  9 ggplot2 Package An impl… 0.7     2008… Hadle… Hadley… "An im… GPL    
-#> 10 ggplot2 Package An impl… 0.8     2008… Hadle… Hadley… "An im… GPL    
-#> # … with 34 more rows, 21 more variables: SaveImage <chr>,              
-#> #   LazyData <chr>, Packaged <chr>, crandb_file_date <chr>, date <chr>, 
-#> #   dependencies <list>, URL <chr>, LazyLoad <chr>, Extends <chr>,      
-#> #   Collate <chr>, Repository <chr>, `Date/Publication` <chr>,          
-#> #   NeedsCompilation <chr>, VignetteBuilder <chr>, BugReports <chr>,    
-#> #   `Authors@R` <chr>, RoxygenNote <chr>, Encoding <chr>, MD5sum <chr>, 
-#> #   `Config/Needs/website` <chr>, `Config/testthat/edition` <chr>, …    
-
-}} +```{asciicast pkg-history, R.options = list(width = 72)} +pkg_history("ggplot2") +``` } diff --git a/man/pkg_install.Rd b/man/pkg_install.Rd index ae1df2527..42143d535 100644 --- a/man/pkg_install.Rd +++ b/man/pkg_install.Rd @@ -14,33 +14,31 @@ pkg_install( } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} -\item{lib}{Package library to install the packages to. Note that \emph{all} +\item{lib}{Package library to install the packages to. Note that _all_ dependent packages will be installed here, even if they are already installed in another library. The only exceptions are base -and recommended packages installed in \code{.Library}. These are not -duplicated in \code{lib}, unless a newer version of a recommemded package +and recommended packages installed in `.Library`. These are not +duplicated in `lib`, unless a newer version of a recommemded package is needed.} -\item{upgrade}{When \code{FALSE}, the default, pak does the minimum amount -of work to give you the latest version(s) of \code{pkg}. It will only upgrade -dependent packages if \code{pkg}, or one of their dependencies explicitly -require a higher version than what you currently have. It will also -prefer a binary package over to source package, even it the binary -package is older. +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. -When \code{upgrade = TRUE}, pak will ensure that you have the latest -version(s) of \code{pkg} and all their dependencies.} + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} \item{ask}{Whether to ask for confirmation when installing a different version of a package that is already installed. Installations that only @@ -48,19 +46,17 @@ add new packages never require confirmation.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} } \value{ (Invisibly) A data frame with information about the installed -package(s). + package(s). } \description{ Install one or more packages and their dependencies into a single @@ -68,151 +64,30 @@ package library. } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{pkg_install("dplyr") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will install 5 packages.                                              
-#> → All 5 packages (2.14 MB) are cached.                                  
-#> + dplyr        1.0.9                                                    
-#> + generics     0.1.2                                                    
-#> + purrr        0.3.4                                                    
-#> + R6           2.5.1                                                    
-#> + tidyselect   1.1.2                                                    
-#>  No downloads are needed, 5 pkgs (2.14 MB) are cached                  
-#>  Got R6 2.5.1 (aarch64-apple-darwin20) (82.52 kB)                      
-#>  Installed R6 2.5.1  (43ms)                                            
-#>  Installed generics 0.1.2  (62ms)                                      
-#>  Installed dplyr 1.0.9  (88ms)                                         
-#>  Installed purrr 0.3.4  (88ms)                                         
-#>  Installed tidyselect 1.1.2  (94ms)                                    
-#>  1 pkg + 17 deps: kept 12, added 5, dld 1 (82.52 kB) [1.2s]            
-
-}} - +```{asciicast pkg-install-dplyr} +pkg_install("dplyr") +``` Upgrade dplyr and all its dependencies: - -\if{html}{\out{
}}\preformatted{pkg_install("dplyr", upgrade = TRUE) -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> → Will update 1 package.                                                
-#> → The package (742.51 kB) is cached.                                    
-#> + rlang 1.0.2 → 1.0.3 👷🏿‍♀️🔧                                            
-#>  No downloads are needed, 1 pkg (742.51 kB) is cached                  
-#>  Building rlang 1.0.3                                                  
-#>  Built rlang 1.0.3 (5.8s)                                              
-#>  Installed rlang 1.0.3  (32ms)                                         
-#>  1 pkg + 17 deps: kept 17, upd 1 [6.3s]                                
-
-}} - +```{asciicast pkg-install-upgrade} +pkg_install("dplyr", upgrade = TRUE) +```` Install the development version of dplyr: - -\if{html}{\out{
}}\preformatted{pkg_install("tidyverse/dplyr") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Loading metadata database ... done                                    
-#>                                                                         
-#> → Will install 16 packages.                                             
-#> → All 16 packages (8.09 MB) are cached.                                 
-#> + cli          3.4.1                                                    
-#> + dplyr        1.0.99.9000 👷🏾‍♂️🔧 (GitHub: e6252f8)                     
-#> + fansi        1.0.3                                                    
-#> + generics     0.1.3                                                    
-#> + glue         1.6.2                                                    
-#> + lifecycle    1.0.3                                                    
-#> + magrittr     2.0.3                                                    
-#> + pillar       1.8.1                                                    
-#> + pkgconfig    2.0.3                                                    
-#> + R6           2.5.1                                                    
-#> + rlang        1.0.6                                                    
-#> + tibble       3.1.8                                                    
-#> + tidyselect   1.2.0                                                    
-#> + utf8         1.2.2                                                    
-#> + vctrs        0.5.1                                                    
-#> + withr        2.5.0                                                    
-#>  No downloads are needed, 16 pkgs (8.09 MB) are cached                 
-#>  Installed R6 2.5.1  (58ms)                                            
-#>  Installed cli 3.4.1  (69ms)                                           
-#>  Installed fansi 1.0.3  (92ms)                                         
-#>  Installed generics 0.1.3  (99ms)                                      
-#>  Installed glue 1.6.2  (108ms)                                         
-#>  Installed lifecycle 1.0.3  (144ms)                                    
-#>  Installed magrittr 2.0.3  (152ms)                                     
-#>  Installed pillar 1.8.1  (160ms)                                       
-#>  Installed pkgconfig 2.0.3  (63ms)                                     
-#>  Installed rlang 1.0.6  (37ms)                                         
-#>  Installed tibble 3.1.8  (41ms)                                        
-#>  Installed tidyselect 1.2.0  (38ms)                                    
-#>  Installed utf8 1.2.2  (36ms)                                          
-#>  Installed vctrs 0.5.1  (39ms)                                         
-#>  Installed withr 2.5.0  (30ms)                                         
-#>  Packaging dplyr 1.0.99.9000                                           
-#>  Packaged dplyr 1.0.99.9000 (8.3s)                                     
-#>  Building dplyr 1.0.99.9000                                            
-#>  Built dplyr 1.0.99.9000 (5.2s)                                        
-#>  Installed dplyr 1.0.99.9000 (github::tidyverse/dplyr@e6252f8) (24ms)  
-#>  1 pkg + 15 deps: added 16 [18.9s]                                     
-
-}} - +```{asciicast pkg-install-gh} +pkg_install("tidyverse/dplyr") +``` Switch back to the CRAN version. This will be fast because pak will have cached the prior install. - -\if{html}{\out{
}}\preformatted{pkg_install("dplyr") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>  Updated metadata database: 2.43 MB in 6 files.                        
-#>  Updating metadata database ... done                                   
-#>                                                                         
-#> → Will install 16 packages.                                             
-#> → All 16 packages (9.42 MB) are cached.                                 
-#> + cli          3.4.1                                                    
-#> + dplyr        1.0.10                                                   
-#> + fansi        1.0.3                                                    
-#> + generics     0.1.3                                                    
-#> + glue         1.6.2                                                    
-#> + lifecycle    1.0.3                                                    
-#> + magrittr     2.0.3                                                    
-#> + pillar       1.8.1                                                    
-#> + pkgconfig    2.0.3                                                    
-#> + R6           2.5.1                                                    
-#> + rlang        1.0.6                                                    
-#> + tibble       3.1.8                                                    
-#> + tidyselect   1.2.0                                                    
-#> + utf8         1.2.2                                                    
-#> + vctrs        0.5.1                                                    
-#> + withr        2.5.0                                                    
-#>  No downloads are needed, 16 pkgs (9.42 MB) are cached                 
-#>  Installed R6 2.5.1  (66ms)                                            
-#>  Installed cli 3.4.1  (76ms)                                           
-#>  Installed dplyr 1.0.10  (111ms)                                       
-#>  Installed fansi 1.0.3  (119ms)                                        
-#>  Installed generics 0.1.3  (125ms)                                     
-#>  Installed glue 1.6.2  (132ms)                                         
-#>  Installed lifecycle 1.0.3  (149ms)                                    
-#>  Installed magrittr 2.0.3  (162ms)                                     
-#>  Installed pillar 1.8.1  (56ms)                                        
-#>  Installed pkgconfig 2.0.3  (35ms)                                     
-#>  Installed rlang 1.0.6  (57ms)                                         
-#>  Installed tibble 3.1.8  (41ms)                                        
-#>  Installed tidyselect 1.2.0  (40ms)                                    
-#>  Installed utf8 1.2.2  (37ms)                                          
-#>  Installed vctrs 0.5.1  (39ms)                                         
-#>  Installed withr 2.5.0  (31ms)                                         
-#>  1 pkg + 15 deps: added 16 [7.2s]                                      
-
-}} +```{asciicast pkg-install-cran} +pkg_install("dplyr") +``` } \seealso{ -\link{Get started with pak}, \link{Package sources}, \link{FAQ}, -\link{The dependency solver}. +[Get started with pak], [Package sources], [FAQ], + [The dependency solver]. Other package functions: \code{\link{lib_status}()}, @@ -220,6 +95,7 @@ Other package functions: \code{\link{pkg_deps_tree}()}, \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} diff --git a/man/pkg_load.Rd b/man/pkg_load.Rd new file mode 100644 index 000000000..4174835ea --- /dev/null +++ b/man/pkg_load.Rd @@ -0,0 +1,108 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/package.R +\name{pkg_load} +\alias{pkg_load} +\title{Load packages} +\usage{ +pkg_load( + pkg, + install = TRUE, + lib = .libPaths()[[1L]], + upgrade = FALSE, + ask = interactive(), + dependencies = NA +) +} +\arguments{ +\item{pkg}{Package names or package references. E.g. +- `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, +- `tidyverse/ggplot2`: package from GitHub, +- `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, +- `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, +- `.`: package in the current working directory.} + +\item{install}{Whether to install missing packages. If TRUE, missing packages + will be installed with pkg_install(). If FALSE, only try to load the #' + packages + + See "[Package sources]" for more details.} + +\item{lib}{Package library to install the packages to. Note that _all_ +dependent packages will be installed here, even if they are +already installed in another library. The only exceptions are base +and recommended packages installed in `.Library`. These are not +duplicated in `lib`, unless a newer version of a recommemded package +is needed.} + +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. + + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} + +\item{ask}{Whether to ask for confirmation when installing a different +version of a package that is already installed. Installations that only +add new packages never require confirmation.} + +\item{dependencies}{What kinds of dependencies to install. Most commonly +one of the following values: +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} +} +\value{ +(Invisibly) A data frame with information about the installed + package(s). +} +\description{ +Load packages, if missing try to install one or more packages and their +dependencies into a single package library. +} +\section{Examples}{ + +```{asciicast pkg-install-dplyr} +pkg_load("dplyr") +``` + +Upgrade dplyr and all its dependencies: +```{asciicast pkg-install-upgrade} +pkg_load("dplyr", upgrade = TRUE) +```` + +Install the development version of dplyr: +```{asciicast pkg-install-gh} +pkg_load("tidyverse/dplyr") +``` + +Switch back to the CRAN version. This will be fast because +pak will have cached the prior install. +```{asciicast pkg-install-cran} +pkg_load("dplyr") +``` +} + +\seealso{ +[Get started with pak], [Package sources], [FAQ], + [The dependency solver]. + +Other package functions: +\code{\link{lib_status}()}, +\code{\link{pak}()}, +\code{\link{pkg_deps_tree}()}, +\code{\link{pkg_deps}()}, +\code{\link{pkg_download}()}, +\code{\link{pkg_install}()}, +\code{\link{pkg_remove}()}, +\code{\link{pkg_status}()}, +\code{\link{pkg_sysreqs}()} +} +\concept{package functions} diff --git a/man/pkg_name_check.Rd b/man/pkg_name_check.Rd index 07db18810..edb2b08bc 100644 --- a/man/pkg_name_check.Rd +++ b/man/pkg_name_check.Rd @@ -13,6 +13,7 @@ pkg_name_check(name, dictionaries = NULL) Available dictionaries: * \code{wikipedia} * \code{wiktionary}, +* \code{acromine} (\url{http://www.nactem.ac.uk/software/acromine/}), * \code{sentiment} (\url{https://github.com/fnielsen/afinn}), * \code{urban} (Urban Dictionary). If \code{NULL} (by default), the Urban Dictionary is omitted, as it @@ -58,33 +59,8 @@ See the \code{dictionaries} argument. } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{pkg_name_check("sicily") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> ╔══════════════════════════════════════════════════════════════════════╗
-#>                             –*– sicily –*–                            
-#> ╚══════════════════════════════════════════════════════════════════════╝
-#> ┌──────────────────────────────────────────────────────────────────────┐
-#>    valid name            CRAN                 Bioconductor         
-#>    not a profanity                                                   
-#> └──────────────────────────────────────────────────────────────────────┘
-#> Wikipedia ───────────────────────────────────────────────────────────┐
-#>  Sicily Sicily (Italian: Sicilia [siˈtʃiːlja], Sicilian               
-#>  pronunciation: [sɪˈʃiːlja]) is the largest island in the             
-#>  Mediterranean Sea and one of the 20 regions of Italy. The Strait of  
-#>  Messina divides it from the region of Calabria in Southern Italy.    
-#>  It is one of the five Italian autonomous regions and is officially   
-#>  referred to as Regione Siciliana. The region has 5 million           
-#> 
-#> └──────────────────────────────── https://en.wikipedia.org/wiki/Sicily
-#> Wiktionary ──────────────────────────────────────────────────────────┐
-#>  sicily No English definition found                                   
-#> └────────────────────────────────────────────────────────────────────  ┘
-#> ┌──────────────────────────────────────────────────────────────────────┐
-#>  Sentiment: 😐 (0)                                                     
-#> └──────────────────────────────────────────────────────────────────────┘
-
-}} +```{asciicast pkg-name-check} +pkg_name_check("sicily") +``` } diff --git a/man/pkg_remove.Rd b/man/pkg_remove.Rd index 31171ebad..92351852f 100644 --- a/man/pkg_remove.Rd +++ b/man/pkg_remove.Rd @@ -25,6 +25,7 @@ Other package functions: \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_status}()}, \code{\link{pkg_sysreqs}()} } diff --git a/man/pkg_search.Rd b/man/pkg_search.Rd index 11c167b9d..1617c65a9 100644 --- a/man/pkg_search.Rd +++ b/man/pkg_search.Rd @@ -9,86 +9,30 @@ pkg_search(query, ...) \arguments{ \item{query}{Search query string.} -\item{...}{Additional arguments passed to \code{\link[pkgsearch:pkg_search]{pkgsearch::pkg_search()}}} +\item{...}{Additional arguments passed to [pkgsearch::pkg_search()]} } \value{ -A data frame, that is also a \code{pak_search_result} object +A data frame, that is also a `pak_search_result` object with a custom print method. To see the underlying table, you -can use \verb{[]} to drop the extra classes. See examples below. +can use `[]` to drop the extra classes. See examples below. } \description{ Search the indexed database of current CRAN packages. It uses the pkgsearch package. See that package for more details and also -\code{\link[pkgsearch:pkg_search]{pkgsearch::pkg_search()}} for pagination, more advanced searching, +[pkgsearch::pkg_search()] for pagination, more advanced searching, etc. } \section{Examples}{ Simple search - -\if{html}{\out{
}}\preformatted{pkg_search("survival") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                                                         
-#> 1 survival 3.4.0 -- by Terry M Therneau, 4 months ago                   
-#>   Survival Analysis                                                     
-#>                                                                         
-#> 2 survminer 0.4.9 -- by Alboukadel Kassambara, 2 years ago              
-#>   Drawing Survival Curves using 'ggplot2'                               
-#>                                                                         
-#> 3 flexsurv 2.2 -- by Christopher Jackson, 6 months ago                  
-#>   Flexible Parametric Survival and Multi-State Models                   
-#>                                                                         
-#> 4 muhaz 1.2.6.4 -- by David Winsemius, 2 years ago                      
-#>   Hazard Function Estimation in Survival Analysis                       
-#>                                                                         
-#> 5 pec 2022.5.4 -- by Thomas A. Gerds, 8 months ago                      
-#>   Prediction Error Curves for Risk Prediction Models in Survival Analysi
-#> s                                                                       
-#>                                                                         
-#> 6 randomForestSRC 3.1.1 -- by Udaya B. Kogalur, 5 months ago            
-#>   Fast Unified Random Forests for Survival, Regression, and Classificati
-#> on (RF-SRC)                                                             
-#>                                                                         
-#> 7 relsurv 2.2.8 -- by Damjan Manevski, 4 months ago                     
-#>   Relative Survival                                                     
-#>                                                                         
-#> 8 survRM2 1.0.4 -- by Hajime Uno, 6 months ago                          
-#>   Comparing Restricted Mean Survival Time                               
-#>                                                                         
-#> 9 titanic 0.1.0 -- by Paul Hendricks, 7 years ago                       
-#>   Titanic Passenger Survival Data Set                                   
-#>                                                                         
-#> 10 KMsurv 0.1.5 -- by Jun Yan, 10 years ago                             
-#>   Data sets from Klein and Moeschberger (1997), Survival Analysis       
-
-}} - +```{asciicast pkg-search, R.options = list(width = 72)} +pkg_search("survival") +``` See the underlying data frame - -\if{html}{\out{
}}\preformatted{psro <- pkg_search("ropensci") +```{asciicast pkg-search-2, R.options = list(width = 72)} +psro <- pkg_search("ropensci") psro[] -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 10 × 15                                                 
-#>    score package    version    title descr…¹ date                maint…²
-#>    <dbl> <chr>      <pckg_vrs> <chr> <chr>   <dttm>              <chr>  
-#>  1  538. webmockr   0.8.2      Stub… "Stubb… 2022-08-28 19:20:02 Scott …
-#>  2  520. RSelenium  1.7.9      R Bi… "Provi… 2022-09-02 07:10:11 Ju Yeo…
-#>  3  416. tracerer   2.2.2      Trac… "'BEAS… 2021-05-30 08:40:03 Richèl…
-#>  4  376. rfisheries 0.2        'Pro… "A pro… 2016-02-19 08:50:03 Karthi…
-#>  5  367. mcbette    1.15       Mode… "'BEAS… 2022-08-27 12:30:02 Richèl…
-#>  6  359. taxize     0.9.100    Taxo… "Inter… 2022-04-22 07:30:02 Zachar…
-#>  7  350. beastier   2.4.11     Call… "'BEAS… 2022-08-11 13:40:04 Richèl…
-#>  8  347. spocc      1.2.0      Inte… "A pro… 2021-01-05 19:50:03 Scott …
-#>  9  316. chromer    0.3        Inte… "A pro… 2022-10-27 22:45:36 Karl W…
-#> 10  315. visdat     0.5.3      Prel… "Creat… 2019-02-15 14:30:03 Nichol…
-#> # … with 8 more variables: maintainer_email <chr>, revdeps <int>,       
-#> #   downloads_last_month <int>, license <chr>, url <chr>,               
-#> #   bugreports <chr>, package_data <I<list>>, ago <chr>, and            
-#> #   abbreviated variable names ¹​description, ²​maintainer_name         
-
-}} +``` } diff --git a/man/pkg_status.Rd b/man/pkg_status.Rd index 26ddbe796..30d6df694 100644 --- a/man/pkg_status.Rd +++ b/man/pkg_status.Rd @@ -13,32 +13,17 @@ pkg_status(pkg, lib = .libPaths()) By default all libraries are used.} } \value{ -Data frame with data about installations of \code{pkg}. -\eval{include_docs("pkgdepends", "docs/lib-status-return.rds")} +Data frame with data about installations of `pkg`. + \eval{include_docs("pkgdepends", "docs/lib-status-return.rds")} } \description{ Display installed locations of a package } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{pkg_status("MASS") -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 2 × 39                                                  
-#>   library    package title version depends repos…¹ license needs…² built
-#> * <chr>      <chr>   <chr> <chr>   <chr>   <chr>   <chr>   <lgl>   <chr>
-#> 1 /Users/ga… MASS    Supp… 7.3-58… R (>= … CRAN    GPL-2 … TRUE    R 4.…
-#> 2 /Library/… MASS    Supp… 7.3-58… R (>= … CRAN    GPL-2 … TRUE    R 4.…
-#> # … with 30 more variables: remotetype <chr>, remotepkgref <chr>,       
-#> #   remoteref <chr>, remoterepos <chr>, remotepkgplatform <chr>,        
-#> #   remotesha <chr>, imports <chr>, suggests <chr>, linkingto <chr>,    
-#> #   remotes <chr>, remotehost <chr>, remoterepo <chr>,                  
-#> #   remoteusername <chr>, enhances <chr>, biocviews <chr>,              
-#> #   remoteurl <chr>, remotesubdir <chr>, priority <chr>,                
-#> #   remoteetag <chr>, remotepackaged <chr>, md5sum <chr>, …             
-
-}} +```{asciicast pkg-status} +pkg_status("MASS") +``` } \seealso{ @@ -49,6 +34,7 @@ Other package functions: \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_sysreqs}()} } diff --git a/man/pkg_sysreqs.Rd b/man/pkg_sysreqs.Rd index ac71e83f1..3289dd000 100644 --- a/man/pkg_sysreqs.Rd +++ b/man/pkg_sysreqs.Rd @@ -8,72 +8,64 @@ pkg_sysreqs(pkg, upgrade = TRUE, dependencies = NA, sysreqs_platform = NULL) } \arguments{ \item{pkg}{Package names or package references. E.g. -\itemize{ -\item \code{ggplot2}: package from CRAN, Bioconductor or a CRAN-like repository -in general, -\item \code{tidyverse/ggplot2}: package from GitHub, -\item \code{tidyverse/ggplot2@v3.4.0}: package from GitHub tag or branch, -\item \verb{https://examples.com/.../ggplot2_3.3.6.tar.gz}: package from URL, -\item \code{.}: package in the current working directory. -} + - `ggplot2`: package from CRAN, Bioconductor or a CRAN-like repository + in general, + - `tidyverse/ggplot2`: package from GitHub, + - `tidyverse/ggplot2@v3.4.0`: package from GitHub tag or branch, + - `https://examples.com/.../ggplot2_3.3.6.tar.gz`: package from URL, + - `.`: package in the current working directory. -See "\link{Package sources}" for more details.} + See "[Package sources]" for more details.} -\item{upgrade}{When \code{FALSE}, the default, pak does the minimum amount -of work to give you the latest version(s) of \code{pkg}. It will only upgrade -dependent packages if \code{pkg}, or one of their dependencies explicitly -require a higher version than what you currently have. It will also -prefer a binary package over to source package, even it the binary -package is older. +\item{upgrade}{When `FALSE`, the default, pak does the minimum amount + of work to give you the latest version(s) of `pkg`. It will only upgrade + dependent packages if `pkg`, or one of their dependencies explicitly + require a higher version than what you currently have. It will also + prefer a binary package over to source package, even it the binary + package is older. -When \code{upgrade = TRUE}, pak will ensure that you have the latest -version(s) of \code{pkg} and all their dependencies.} + When `upgrade = TRUE`, pak will ensure that you have the latest + version(s) of `pkg` and all their dependencies.} \item{dependencies}{What kinds of dependencies to install. Most commonly one of the following values: -\itemize{ -\item \code{NA}: only required (hard) dependencies, -\item \code{TRUE}: required dependencies plus optional and development -dependencies, -\item \code{FALSE}: do not install any dependencies. (You might end up with a -non-working package, and/or the installation might fail.) -See \link{Package dependency types} for other possible values and more -information about package dependencies. -}} +- `NA`: only required (hard) dependencies, +- `TRUE`: required dependencies plus optional and development + dependencies, +- `FALSE`: do not install any dependencies. (You might end up with a + non-working package, and/or the installation might fail.) +See [Package dependency types] for other possible values and more +information about package dependencies.} -\item{sysreqs_platform}{System requirements platform. If \code{NULL}, then the -\code{sysreqs_platform} \eval{man_config_link("configuration option")} +\item{sysreqs_platform}{System requirements platform. If `NULL`, then the +`sysreqs_platform` \eval{man_config_link("configuration option")} is used, which defaults to the current platform. Set this option if \eval{.packageName} does not detect your platform correctly.} } \value{ List with entries: -\itemize{ -\item \code{os}: character string. Operating system. -\item \code{distribution}: character string. Linux distribution, \code{NA} if the -OS is not Linux. -\item \code{version}: character string. Distribution version, \code{NA} is the OS -is not Linux. -\item \code{pre_install}: character vector. Commands to run before the -installation of system packages. -\item \code{install_scripts}: character vector. Commands to run to install the -system packages. -\item \code{post_install}: character vector. Commands to run after the -installation of system packages. -\item \code{packages}: data frame. Information about the system packages that -are needed. It has columns: -\itemize{ -\item \code{sysreq}: string, cross-platform name of the system requirement. -\item \code{packages}: list column of character vectors. The names of the R -packages that have this system requirement. -\item \code{pre_install}: list column of character vectors. Commands run -before the package installation for this system requirement. -\item \code{system_packages}: list column of character vectors. Names of -system packages to install. -\item \code{post_install}: list column of character vectors. Commands run -after the package installation for this system requirement. -} -} + * `os`: character string. Operating system. + * `distribution`: character string. Linux distribution, `NA` if the + OS is not Linux. + * `version`: character string. Distribution version, `NA` is the OS + is not Linux. + * `pre_install`: character vector. Commands to run before the + installation of system packages. + * `install_scripts`: character vector. Commands to run to install the + system packages. + * `post_install`: character vector. Commands to run after the + installation of system packages. + * `packages`: data frame. Information about the system packages that + are needed. It has columns: + * `sysreq`: string, cross-platform name of the system requirement. + * `packages`: list column of character vectors. The names of the R + packages that have this system requirement. + * `pre_install`: list column of character vectors. Commands run + before the package installation for this system requirement. + * `system_packages`: list column of character vectors. Names of + system packages to install. + * `post_install`: list column of character vectors. Commands run + after the package installation for this system requirement. } \description{ Calculate system requirements of one of more packages @@ -86,6 +78,7 @@ Other package functions: \code{\link{pkg_deps}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, +\code{\link{pkg_load}()}, \code{\link{pkg_remove}()}, \code{\link{pkg_status}()} diff --git a/man/ppm_has_binaries.Rd b/man/ppm_has_binaries.Rd index 96e199a3b..2239ab0e8 100644 --- a/man/ppm_has_binaries.Rd +++ b/man/ppm_has_binaries.Rd @@ -7,7 +7,7 @@ ppm_has_binaries() } \value{ -\code{TRUE} or \code{FALSE}. +`TRUE` or `FALSE`. } \description{ Does PPM build binary packages for the current platform? @@ -20,7 +20,7 @@ ppm_has_binaries() } \seealso{ The 'pkgcache and Posit Package Manager on Linux' -article at \url{https://r-lib.github.io/pkgcache/dev/}. + article at <`r pkgcache:::pkgdown_url()`>. Other PPM functions: \code{\link{ppm_platforms}()}, diff --git a/man/ppm_platforms.Rd b/man/ppm_platforms.Rd index 4300d6f8f..7fa374dcb 100644 --- a/man/ppm_platforms.Rd +++ b/man/ppm_platforms.Rd @@ -8,15 +8,13 @@ ppm_platforms() } \value{ Data frame with columns: -\itemize{ -\item \code{name}: platform name, this is essentially an identifier, -\item \code{os}: operating system, \code{linux}, \code{windows} or \code{macOS} currently, -\item \code{binary_url}: the URL segment of the binary repository URL of this -platform, see \code{\link[=ppm_snapshots]{ppm_snapshots()}}. -\item \code{distribution}: for Linux platforms the name of the distribution, -\item \code{release}: for Linux platforms, the name of the release, -\item \code{binaries}: whether PPM builds binaries for this platform. -} +- `name`: platform name, this is essentially an identifier, +- `os`: operating system, `linux`, `windows` or `macOS` currently, +- `binary_url`: the URL segment of the binary repository URL of this + platform, see [ppm_snapshots()]. +- `distribution`: for Linux platforms the name of the distribution, +- `release`: for Linux platforms, the name of the release, +- `binaries`: whether PPM builds binaries for this platform. } \description{ List all platforms supported by Posit Package Manager (PPM) @@ -28,7 +26,7 @@ ppm_platforms() } \seealso{ The 'pkgcache and Posit Package Manager on Linux' -article at \url{https://r-lib.github.io/pkgcache/dev/}. + article at <`r pkgcache:::pkgdown_url()`>. Other PPM functions: \code{\link{ppm_has_binaries}()}, diff --git a/man/ppm_r_versions.Rd b/man/ppm_r_versions.Rd index ccce5727e..285a2c3dd 100644 --- a/man/ppm_r_versions.Rd +++ b/man/ppm_r_versions.Rd @@ -8,10 +8,8 @@ ppm_r_versions() } \value{ Data frame with columns: -\itemize{ -\item \code{r_version}: minor R versions, i.e. version numbers containing the -first two components of R versions supported by this PPM instance. -} +- `r_version`: minor R versions, i.e. version numbers containing the + first two components of R versions supported by this PPM instance. } \description{ List all R versions supported by Posit Package Manager (PPM) @@ -23,7 +21,7 @@ ppm_r_versions() } \seealso{ The 'pkgcache and Posit Package Manager on Linux' -article at \url{https://r-lib.github.io/pkgcache/dev/}. + article at <`r pkgcache:::pkgdown_url()`>. Other PPM functions: \code{\link{ppm_has_binaries}()}, diff --git a/man/ppm_repo_url.Rd b/man/ppm_repo_url.Rd index fbc19a809..1b24c013a 100644 --- a/man/ppm_repo_url.Rd +++ b/man/ppm_repo_url.Rd @@ -8,34 +8,34 @@ ppm_repo_url() } \value{ String scalar, the repository URL of the configured PPM -instance. If no PPM instance is configured, then the URL of the Posit -Public Package Manager instance. It includes the repository name, e.g. -\verb{https://packagemanager.posit.co/all}. + instance. If no PPM instance is configured, then the URL of the Posit + Public Package Manager instance. It includes the repository name, e.g. + `https://packagemanager.posit.co/all`. } \description{ Returns the current Posit Package Manager (PPM) repository URL } \details{ -This URL has the form \code{{base}/{repo}}, e.g. -\verb{https://packagemanager.posit.co/all}. +This URL has the form `{base}/{repo}`, e.g. +`https://packagemanager.posit.co/all`. -To configure a hosted PPM instance, set the \code{PKGCACHE_PPM_URL} +To configure a hosted PPM instance, set the `PKGCACHE_PPM_URL` environment variable to the base URL (e.g. -\verb{https://packagemanager.posit.co}). +`https://packagemanager.posit.co`). -To use \code{\link[=repo_add]{repo_add()}} with PPM snapshots, you may also set the -\code{PKGCACHE_PPM_REPO} environment variable to the name of the default +To use [repo_add()] with PPM snapshots, you may also set the +`PKGCACHE_PPM_REPO` environment variable to the name of the default repository. On Linux, instead of setting these environment variables, you can also -add a PPM repository to the \code{repos} option, see \code{\link[base:options]{base::options()}}. -In the environment variables are not set, then \code{ppm_repo_url()} will +add a PPM repository to the `repos` option, see [base::options()]. +In the environment variables are not set, then `ppm_repo_url()` will try extract the PPM base URL and repository name from this option. -If the \code{PKGCACHE_PPM_URL} environment variable is not set, and the -\code{repos} option does not contain a PPM URL (on Linux), then pak -uses the public PPM instance at \verb{https://packagemanager.posit.co}, with -the \code{cran} repository. +If the `PKGCACHE_PPM_URL` environment variable is not set, and the +`repos` option does not contain a PPM URL (on Linux), then pak +uses the public PPM instance at `https://packagemanager.posit.co`, with +the `cran` repository. } \examples{ \dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} @@ -44,10 +44,10 @@ ppm_repo_url() } \seealso{ The 'pkgcache and Posit Package Manager on Linux' -article at \url{https://r-lib.github.io/pkgcache/dev/}. + article at <`r pkgcache:::pkgdown_url()`>. -\code{\link[=repo_resolve]{repo_resolve()}} and \code{\link[=repo_add]{repo_add()}} to find and configure PPM -snapshots. +[repo_resolve()] and [repo_add()] to find and configure PPM + snapshots. Other PPM functions: \code{\link{ppm_has_binaries}()}, diff --git a/man/ppm_snapshots.Rd b/man/ppm_snapshots.Rd index f2b08d82a..6503f903a 100644 --- a/man/ppm_snapshots.Rd +++ b/man/ppm_snapshots.Rd @@ -8,38 +8,34 @@ ppm_snapshots() } \value{ Data frame with two columns: -\itemize{ -\item \code{date}: the time the snapshot was taken, a \code{POSIXct} vector, -\item \code{id}: integer id of the snapshot, this can be used in the repository -URL. -} +- `date`: the time the snapshot was taken, a `POSIXct` vector, +- `id`: integer id of the snapshot, this can be used in the repository + URL. } \description{ List all available Posit Package Manager (PPM) snapshots } \details{ The repository URL of a snapshot has the following form on Windows: - -\if{html}{\out{
}}\preformatted{\{base\}/\{repo\}/\{id\} -}\if{html}{\out{
}} - -where \code{{base}} is the base URL for PPM (see \code{\link[=ppm_repo_url]{ppm_repo_url()}}) and -\code{{id}} is either the date or id of the snapshot, or \code{latest} for +``` +{base}/{repo}/{id} +``` +where `{base}` is the base URL for PPM (see [ppm_repo_url()]) and +`{id}` is either the date or id of the snapshot, or `latest` for the latest snapshot. E.g. these are equivalent: - -\if{html}{\out{
}}\preformatted{https://packagemanager.posit.co/cran/5 +``` +https://packagemanager.posit.co/cran/5 https://packagemanager.posit.co/cran/2017-10-10 -}\if{html}{\out{
}} +``` On a Linux distribution that has PPM support, the repository URL that contains the binary packages looks like this: - -\if{html}{\out{
}}\preformatted{\{base\}/\{repo\}/__linux__/\{binary_url\}/\{id\} -}\if{html}{\out{
}} - -where \code{{id}} is as before, and \code{{binary_url}} is a code name for a release -of a supported Linux distribution. See the \code{binary_url} column of the -result of \code{\link[=ppm_platforms]{ppm_platforms()}} for these code names. +``` +{base}/{repo}/__linux__/{binary_url}/{id} +``` +where `{id}` is as before, and `{binary_url}` is a code name for a release +of a supported Linux distribution. See the `binary_url` column of the +result of [ppm_platforms()] for these code names. } \examples{ \dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} @@ -48,7 +44,7 @@ ppm_snapshots() } \seealso{ The 'pkgcache and Posit Package Manager on Linux' -article at \url{https://r-lib.github.io/pkgcache/dev/}. + article at <`r pkgcache:::pkgdown_url()`>. Other PPM functions: \code{\link{ppm_has_binaries}()}, diff --git a/man/repo_add.Rd b/man/repo_add.Rd index b71efd8f0..8e65c2620 100644 --- a/man/repo_add.Rd +++ b/man/repo_add.Rd @@ -14,14 +14,14 @@ repo_resolve(spec) See details below.} \item{.list}{List or character vector of repository specifications. -This argument is easier to use programmatically than \code{...}. See +This argument is easier to use programmatically than `...`. See details below.} \item{spec}{Repository specification, a possibly named character scalar.} } \value{ -\code{repo_resolve()} returns a named character scalar, the URL +`repo_resolve()` returns a named character scalar, the URL of the repository. } \description{ @@ -29,130 +29,80 @@ Add a new repository to the list of repositories that pak uses to look for packages. } \details{ -\code{repo_add()} adds new repositories. It resolves the specified -repositories using \code{repo_resolve()} and then modifies the \code{repos} +`repo_add()` adds new repositories. It resolves the specified +repositories using `repo_resolve()` and then modifies the `repos` global option. -\code{repo_add()} only has an effect in the current R session. If you +`repo_add()` only has an effect in the current R session. If you want to keep your configuration between R sessions, then set the -\code{repos} option to the desired value in your user or project \code{.Rprofile} +`repos` option to the desired value in your user or project `.Rprofile` file. -} -\section{Repository specifications}{ + + +# Repository specifications + The format of a repository specification is a named or unnamed character scalar. If the name is missing, pak adds a name -automatically. The repository named \code{CRAN} is the main CRAN repository, +automatically. The repository named `CRAN` is the main CRAN repository, but otherwise names are informational. Currently supported repository specifications: -\itemize{ -\item URL pointing to the root of the CRAN-like repository. Example: +- URL pointing to the root of the CRAN-like repository. Example: + ``` + https://cloud.r-project.org + ``` +- `RSPM@`, RSPM (RStudio Package Manager) snapshot, at the + specified date. +- `RSPM@-` RSPM snapshot, for the day after the + release of `` of ``. +- `RSPM@R-` RSPM snapshot, for the day after R `` + was released. +- `MRAN@`, MRAN (Microsoft R Application Network) snapshot, at + the specified date. +- `MRAN@-` MRAN snapshot, for the + day after the release of `` of ``. +- `MRAN@R-` MRAN snapshot, for the day + after R `` was released. -\if{html}{\out{
}}\preformatted{https://cloud.r-project.org -}\if{html}{\out{
}} -\item \verb{RSPM@}, RSPM (RStudio Package Manager) snapshot, at the -specified date. -\item \verb{RSPM@-} RSPM snapshot, for the day after the -release of \verb{} of \verb{}. -\item \verb{RSPM@R-} RSPM snapshot, for the day after R \verb{} -was released. -\item \verb{MRAN@}, MRAN (Microsoft R Application Network) snapshot, at -the specified date. -\item \verb{MRAN@-} MRAN snapshot, for the -day after the release of \verb{} of \verb{}. -\item \verb{MRAN@R-} MRAN snapshot, for the day -after R \verb{} was released. -} Notes: -\itemize{ -\item See more about RSPM at \verb{https://packagemanager.rstudio.com/client/#/}. -\item See more about MRAN snapshots at -\url{https://mran.microsoft.com/timemachine}. -\item All dates (or times) can be specified in the ISO 8601 format. -\item If RSPM does not have a snapshot available for a date, the next -available date is used. -\item Dates that are before the first, or after the last RSPM snapshot -will trigger an error. -\item Dates before the first, or after the last MRAN snapshot will trigger -an error. -\item Unknown R or package versions will trigger an error. +* See more about RSPM at `https://packagemanager.rstudio.com/client/#/`. +* See more about MRAN snapshots at + . +* All dates (or times) can be specified in the ISO 8601 format. +* If RSPM does not have a snapshot available for a date, the next + available date is used. +* Dates that are before the first, or after the last RSPM snapshot + will trigger an error. +* Dates before the first, or after the last MRAN snapshot will trigger + an error. +* Unknown R or package versions will trigger an error. } -} - \section{Exaples}{ - -\if{html}{\out{
}}\preformatted{repo_add(RSPMdplyr100 = "RSPM@dplyr-1.0.0") +```{asciicast repo-add} +repo_add(RSPMdplyr100 = "RSPM@dplyr-1.0.0") repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # 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 RSPMdplyr100  https://packagemanager.posit.co/c… cran… *       NA     
-#> 3 BioCsoft      https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 4 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 6 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_resolve("MRAN@2020-01-21") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                             CRAN                        
-#> "https://cran.microsoft.com/snapshot/2020-01-21"                        
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_resolve("RSPM@2020-01-21") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                       CRAN                              
-#> "https://packagemanager.posit.co/cran/245"                              
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_resolve("MRAN@dplyr-1.0.0") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                             CRAN                        
-#> "https://cran.microsoft.com/snapshot/2020-05-30"                        
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_resolve("RSPM@dplyr-1.0.0") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                       CRAN                              
-#> "https://packagemanager.posit.co/cran/289"                              
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_resolve("MRAN@R-4.0.0") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                             CRAN                        
-#> "https://cran.microsoft.com/snapshot/2020-04-25"                        
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_resolve("RSPM@R-4.0.0") -}\if{html}{\out{
}}\if{html}{\out{ -
-#>                                       CRAN                              
-#> "https://packagemanager.posit.co/cran/276"                              
-
-}} +``` + +```{asciicast repo-add-2} +repo_resolve("MRAN@2020-01-21") +``` +```{asciicast repo-add-3} +repo_resolve("RSPM@2020-01-21") +``` +```{asciicast repo-add-4} +repo_resolve("MRAN@dplyr-1.0.0") +``` +```{asciicast repo-add-5} +repo_resolve("RSPM@dplyr-1.0.0") +``` +```{asciicast repo-add-6} +repo_resolve("MRAN@R-4.0.0") +``` +```{asciicast repo-add-7} +repo_resolve("RSPM@R-4.0.0") +``` } \seealso{ diff --git a/man/repo_get.Rd b/man/repo_get.Rd index 1ef531fdc..a84ab04c6 100644 --- a/man/repo_get.Rd +++ b/man/repo_get.Rd @@ -8,39 +8,27 @@ repo_get(r_version = getRversion(), bioc = TRUE, cran_mirror = NULL) } \arguments{ \item{r_version}{R version to use to determine the correct Bioconductor -version, if \code{bioc = TRUE}.} +version, if `bioc = TRUE`.} \item{bioc}{Whether to automatically add the Bioconductor repositories to the result.} -\item{cran_mirror}{CRAN mirror to use. Leave it at \code{NULL} to use the -mirror in \code{getOption("repos")} or an automatically selected one.} +\item{cran_mirror}{CRAN mirror to use. Leave it at `NULL` to use the +mirror in `getOption("repos")` or an automatically selected one.} } \description{ -pak uses the \code{repos} option, see \code{\link[=options]{options()}}. It also automatically +pak uses the `repos` option, see [options()]. It also automatically adds a CRAN mirror if none is set up, and the correct version of the -Bioconductor repositories. See the \code{cran_mirror} and \code{bioc} arguments. +Bioconductor repositories. See the `cran_mirror` and `bioc` arguments. } \details{ -\code{repo_get()} returns the table of the currently configured repositories. +`repo_get()` returns the table of the currently configured repositories. } \section{Examples}{ - -\if{html}{\out{
}}\preformatted{repo_get() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # 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… bioc  4.2.2   3.16   
-#> 3 BioCann       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 4 BioCexp       https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> 5 BioCworkflows https://bioconductor.org/packages… bioc  4.2.2   3.16   
-#> # … with abbreviated variable names ¹​r_version, ²​bioc_version         
-
-}} +```{asciicast repo-get} +repo_get() +``` } \seealso{ diff --git a/man/repo_status.Rd b/man/repo_status.Rd index 4a48f62c7..0c2375b47 100644 --- a/man/repo_status.Rd +++ b/man/repo_status.Rd @@ -24,112 +24,60 @@ repo_ping( plus source packages.} \item{r_version}{R version(s) to use, the default is the current -R version, via \code{\link[=getRversion]{getRversion()}}.} +R version, via [getRversion()].} \item{bioc}{Whether to add the Bioconductor repositories. If you -already configured them via \code{options(repos)}, then you can -set this to \code{FALSE}.} +already configured them via `options(repos)`, then you can +set this to `FALSE`.} \item{cran_mirror}{The CRAN mirror to use.} } \value{ A data frame that has a row for every repository, on every queried platform and R version. It has these columns: -\itemize{ -\item \code{name}: the name of the repository. This comes from the names -of the configured repositories in \code{options("repos")}, or -added by pkgcache. It is typically \code{CRAN} for CRAN, and the -current Bioconductor repositories are \code{BioCsoft}, \code{BioCann}, -\code{BioCexp}, \code{BioCworkflows}. -\item \code{url}: base URL of the repository. -\item \code{bioc_version}: Bioconductor version, or \code{NA} for -non-Bioconductor repositories. -\item \code{platform}: platform, possible values are \code{source}, \code{macos} and -\code{windows} currently. -\item \code{path}: the path to the packages within the base URL, for a -given platform and R version. -\item \code{r_version}: R version, one of the specified R versions. -\item \code{ok}: Logical flag, whether the repository contains a metadata -file for the given platform and R version. -\item \code{ping}: HTTP response time of the repository in seconds. If -the \code{ok} column is \code{FALSE}, then this columns in \code{NA}. -\item \code{error}: the error object if the HTTP query failed for this -repository, platform and R version. -} +* `name`: the name of the repository. This comes from the names + of the configured repositories in `options("repos")`, or + added by pkgcache. It is typically `CRAN` for CRAN, and the + current Bioconductor repositories are `BioCsoft`, `BioCann`, + `BioCexp`, `BioCworkflows`. +* `url`: base URL of the repository. +* `bioc_version`: Bioconductor version, or `NA` for + non-Bioconductor repositories. +* `platform`: platform, possible values are `source`, `macos` and + `windows` currently. +* `path`: the path to the packages within the base URL, for a + given platform and R version. +* `r_version`: R version, one of the specified R versions. +* `ok`: Logical flag, whether the repository contains a metadata + file for the given platform and R version. +* `ping`: HTTP response time of the repository in seconds. If + the `ok` column is `FALSE`, then this columns in `NA`. +* `error`: the error object if the HTTP query failed for this + repository, platform and R version. } \description{ It checks the status of the configured or supplied repositories. } \details{ -\code{repo_ping()} is similar to \code{repo_status()} but also prints a short +`repo_ping()` is similar to `repo_status()` but also prints a short summary of the data, and it returns its result invisibly. } \section{Examples}{ +```{asciicast repo-status} +repo_status() +``` -\if{html}{\out{
}}\preformatted{repo_status() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 10 × 10                                                 
-#>    name     url   type  bioc_…¹ platf…² path  r_ver…³ ok     ping error 
-#>    <chr>    <chr> <chr> <chr>   <chr>   <chr> <chr>   <lgl> <dbl> <list>
-#>  1 CRAN     http… cran  NA      source  src/… 4.2     TRUE  0.269 <NULL>
-#>  2 CRAN     http… cran  NA      aarch6… bin/… 4.2     TRUE  0.265 <NULL>
-#>  3 BioCsoft http… bioc  3.16    source  src/… 4.2     TRUE  0.264 <NULL>
-#>  4 BioCsoft http… bioc  3.16    aarch6… bin/… 4.2     TRUE  0.271 <NULL>
-#>  5 BioCann  http… bioc  3.16    source  src/… 4.2     TRUE  0.383 <NULL>
-#>  6 BioCann  http… bioc  3.16    aarch6… bin/… 4.2     TRUE  0.392 <NULL>
-#>  7 BioCexp  http… bioc  3.16    source  src/… 4.2     TRUE  0.507 <NULL>
-#>  8 BioCexp  http… bioc  3.16    aarch6… bin/… 4.2     TRUE  0.739 <NULL>
-#>  9 BioCwor… http… bioc  3.16    source  src/… 4.2     TRUE  0.505 <NULL>
-#> 10 BioCwor… http… bioc  3.16    aarch6… bin/… 4.2     TRUE  0.766 <NULL>
-#> # … with abbreviated variable names ¹​bioc_version, ²​platform,         
-#> #   ³​r_version                                                         
-
-}} - - -\if{html}{\out{
}}\preformatted{repo_status( +```{asciicast repo-status-2} +repo_status( platforms = c("windows", "macos"), r_version = c("4.0", "4.1") ) -}\if{html}{\out{
}}\if{html}{\out{ -
-#> # A data frame: 15 × 10                                                 
-#>    name          url    type  bioc_…¹ platf…² r_ver…³ path  ok      ping
-#>    <chr>         <chr>  <chr> <chr>   <chr>   <chr>   <chr> <lgl>  <dbl>
-#>  1 CRAN          https… cran  NA      i386+x… 4.0     bin/… TRUE   0.198
-#>  2 CRAN          https… cran  NA      i386+x… 4.1     bin/… TRUE   0.197
-#>  3 CRAN          https… cran  NA      aarch6… 4.1     bin/… TRUE   0.197
-#>  4 BioCsoft      https… bioc  3.12    i386+x… 4.0     bin/… TRUE   0.988
-#>  5 BioCann       https… bioc  3.12    i386+x… 4.0     bin/… TRUE   1.03 
-#>  6 BioCexp       https… bioc  3.12    i386+x… 4.0     bin/… TRUE   1.25 
-#>  7 BioCworkflows https… bioc  3.12    i386+x… 4.0     bin/… TRUE   1.47 
-#>  8 BioCsoft      https… bioc  3.14    i386+x… 4.1     bin/… TRUE   1.48 
-#>  9 BioCsoft      https… bioc  3.14    aarch6… 4.1     bin/… FALSE NA    
-#> 10 BioCann       https… bioc  3.14    i386+x… 4.1     bin/… TRUE   1.45 
-#> 11 BioCann       https… bioc  3.14    aarch6… 4.1     bin/… FALSE NA    
-#> 12 BioCexp       https… bioc  3.14    i386+x… 4.1     bin/… TRUE   1.72 
-#> 13 BioCexp       https… bioc  3.14    aarch6… 4.1     bin/… FALSE NA    
-#> 14 BioCworkflows https… bioc  3.14    i386+x… 4.1     bin/… TRUE   1.71 
-#> 15 BioCworkflows https… bioc  3.14    aarch6… 4.1     bin/… FALSE NA    
-#> # … with 1 more variable: error <list>, and abbreviated variable names  
-#> #   ¹​bioc_version, ²​platform, ³​r_version                             
-
-}} - +``` -\if{html}{\out{
}}\preformatted{repo_ping() -}\if{html}{\out{
}}\if{html}{\out{ -
-#> Repository summary:                   source aarch64-apple-darwin20          
-#> CRAN          @ cloud.r-project.org       (194ms)
-#> BioCsoft      @ bioconductor.org          (352ms)
-#> BioCann       @ bioconductor.org          (511ms)
-#> BioCexp       @ bioconductor.org          (675ms)
-#> BioCworkflows @ bioconductor.org          (698ms)
-
-}} +```{asciicast repo-status-3, asciicast_cols = 77, asciicast_width = 77, R.options = list(cli.width = 77, width = 77)} +repo_ping() +``` } \seealso{ diff --git a/man/sysreqs.Rd b/man/sysreqs.Rd index 51cee7586..c9136a1e7 100644 --- a/man/sysreqs.Rd +++ b/man/sysreqs.Rd @@ -7,615 +7,7 @@ \description{ pak takes care of your system requirements. } -\section{Introduction}{ -Many R packages need external software to be present on the machine, -otherwise they do not work, or not even load. For example the RPostgres -R package uses the PostgreSQL client library, and by default dynamically -links to it on Linux systems. This means that you (or the administrators -of your system) need to install this library, typically in the form of a -system package: \code{libpq-dev} on Ubuntu and Debian systems, or -\code{postgresql-server-devel} or \code{postgresql-devel} on RedHat, Fedora, etc. -systems. - -The good news is that pak helps you with this: - it looks up the -required system packages when installing R packages, - it checks if the -required system packages are installed, and - it installs them -automatically, if you are a superuser, or you can use password-less -\code{sudo} to start a superuser shell. - -In addition, pak also has some functions to query system requirements -and system packages. +\details{ +```{r child = "man/chunks/sysreqs.md"} +``` } - -\section{Requirements, supported platforms}{ -Call \code{pak::sysreqs_platforms()} to list all platforms that support -system requirements: - -\if{html}{\out{
}}\preformatted{pak::sysreqs_platforms() -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## # A data frame: 10 × 7                                                  
-##    name        os    distribution version update_command install_command
-##    <chr>       <chr> <chr>        <chr>   <chr>          <chr>          
-##  1 Ubuntu Lin… linux ubuntu       *       apt-get -y up… apt-get -y ins…
-##  2 Debian Lin… linux debian       *       apt-get -y up… apt-get -y ins…
-##  3 CentOS Lin… linux centos       *       NA             yum install -y 
-##  4 Rocky Linux linux rockylinux   *       NA             dnf install -y 
-##  5 Red Hat En… linux redhat       6       NA             yum install -y 
-##  6 Red Hat En… linux redhat       7       NA             yum install -y 
-##  7 Red Hat En… linux redhat       *       NA             dnf install -y 
-##  8 Fedora Lin… linux fedora       *       NA             dnf install -y 
-##  9 openSUSE L… linux opensuse     *       NA             zypper --non-i…
-## 10 SUSE Linux… linux sle          *       NA             zypper --non-i…
-## # ℹ 1 more variable: query_command <chr>                                
-
-}} -\if{html}{\out{ -
-}} - - -Call \code{pak::sysreqs_is_supported()} to see if your system is supported: - -\if{html}{\out{
}}\preformatted{pak::sysreqs_is_supported() -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## [1] TRUE                                                                
-
-}} -\if{html}{\out{ -
-}} - - -This vignette was built on Ubuntu 22.04.2 LTS, which is a platform pak -does support. So in the following you will see the output of the code. -} - -\section{R package installation}{ -If you are using pak as a superuser, on a supported platform, then pak -will look up system requirements, and install the missing ones. Here is -an example: - -\if{html}{\out{
}}\preformatted{pak::pkg_install("RPostgres") -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-##  Loading metadata database ... done                                    
-##                                                                         
-## → Will install 17 packages.                                             
-## → All 17 packages (0 B) are cached.                                     
-## + DBI          1.1.3                                                    
-## + RPostgres    1.4.5   +  libpq-dev                                    
-## + Rcpp         1.0.10                                                   
-## + bit          4.0.5                                                    
-## + bit64        4.0.5                                                    
-## + blob         1.2.4                                                    
-## + cli          3.6.1                                                    
-## + generics     0.1.3                                                    
-## + glue         1.6.2                                                    
-## + hms          1.1.3                                                    
-## + lifecycle    1.0.3                                                    
-## + lubridate    1.9.2                                                    
-## + pkgconfig    2.0.3                                                    
-## + rlang        1.1.1                                                    
-## + timechange   0.2.0                                                    
-## + vctrs        0.6.2                                                    
-## + withr        2.5.0                                                    
-## → Will install 1 system package:                                        
-## + libpq-dev  - RPostgres                                                
-##  No downloads are needed, 17 pkgs are cached                           
-##  Installing system requirements                                        
-##  Executing `sh -c apt-get -y update`                                   
-##  Executing `sh -c apt-get -y install libpq-dev`                        
-##  Installed DBI 1.1.3  (1.1s)                                           
-##  Installed RPostgres 1.4.5  (1.2s)                                     
-##  Installed Rcpp 1.0.10  (1.2s)                                         
-##  Installed bit 4.0.5  (1.2s)                                           
-##  Installed bit64 4.0.5  (148ms)                                        
-##  Installed blob 1.2.4  (63ms)                                          
-##  Installed cli 3.6.1  (88ms)                                           
-##  Installed generics 0.1.3  (61ms)                                      
-##  Installed glue 1.6.2  (63ms)                                          
-##  Installed hms 1.1.3  (62ms)                                           
-##  Installed lifecycle 1.0.3  (61ms)                                     
-##  Installed lubridate 1.9.2  (87ms)                                     
-##  Installed pkgconfig 2.0.3  (62ms)                                     
-##  Installed rlang 1.1.1  (1.1s)                                         
-##  Installed timechange 0.2.0  (1.1s)                                    
-##  Installed vctrs 0.6.2  (1.1s)                                         
-##  Installed withr 2.5.0  (1.1s)                                         
-##  1 pkg + 16 deps: added 17 [17.5s]                                     
-
-}} -\if{html}{\out{ -
-}} - -\subsection{Running R as a regular user}{ - -If you don’t want to use R as the superuser, but you can set up \code{sudo} -without a password, that works as well. pak will automatically detect -the password-less \code{sudo} capability, and use it to install system -packages, as needed. - -If you run R as a regular (not root) user, and password-less \code{sudo} is -not available, then pak will print the system requirements, but it will -not try to install or update them. If you are installing source packages -that need to link to system libraries, then their installation will -probably fail, until you install these system packages. If you are -installing binary R packages, then the installation typically succeeds, -but you won’t be able to load these packages into R, until you install -the required system packages. Here is an example, on a system that does -not have the required system package installed for RPostgres. If you are -installing a source R package, the installation already fails: - -\if{html}{\out{
}}\preformatted{pak::pkg_install("RPostgres?source") -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## + plogr       0.2.0                                                     
-##  Missing 1 system package. You'll probably need to install it          
-## manually:                                                               
-## + libpq-dev  - RPostgres                                                
-##  No downloads are needed, 2 pkgs (1.47 MB) are cached                  
-##  Installed plogr 0.2.0  (1.1s)                                         
-##  Building RPostgres 1.4.5                                              
-##  Failed to build RPostgres 1.4.5                                       
-## Registered S3 methods overwritten by 'callr':                           
-##   method                    from                                        
-##   format.callr_status_error                                             
-##   print.callr_status_error                                              
-## Error:                                                                  
-## ! error in pak subprocess                                               
-## Caused by error in `stop_task_build(state, worker)`:                    
-## ! Failed to build source package 'RPostgres'                            
-## Full installation output:                                               
-## * installing *source* package ‘RPostgres’ ...                           
-## ** package ‘RPostgres’ successfully unpacked and MD5 sums checked       
-## staged installation is only possible with locking                       
-## ** using non-staged installation                                        
-## Using PKG_CFLAGS=                                                       
-## Using PKG_LIBS=-lpq                                                     
-## Using PKG_PLOGR=                                                        
-## ------------------------- ANTICONF ERROR ---------------------------    
-## Configuration failed because libpq was not found. Try installing:       
-##  * deb: libpq-dev libssl-dev (Debian, Ubuntu, etc)                      
-##  * rpm: postgresql-devel (Fedora, EPEL)                                 
-##  * rpm: postgreql8-devel, psstgresql92-devel, postgresql93-devel, or pos
-## tgresql94-devel (Amazon Linux)                                          
-##  * csw: postgresql_dev (Solaris)                                        
-##  * brew: libpq (OSX)                                                    
-## If libpq is already installed, check that either:                       
-## (i)  'pkg-config' is in your PATH AND PKG_CONFIG_PATH contains          
-##      a libpq.pc file; or                                                
-## (ii) 'pg_config' is in your PATH.                                       
-## If neither can detect , you can set INCLUDE_DIR                         
-## and LIB_DIR manually via:                                               
-## R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'            
-## --------------------------[ ERROR MESSAGE ]---------------------------- 
-## <stdin>:1:10: fatal error: libpq-fe.h: No such file or directory        
-## compilation terminated.                                                 
-## ----------------------------------------------------------------------- 
-## ERROR: configuration failed for package ‘RPostgres’                     
-## * removing ‘/tmp/RtmpsOXbPZ/pkg-lib4a492949a49e/RPostgres’              
-## ---                                                                     
-## Backtrace:                                                              
-## 1. pak::pkg_install("RPostgres?source")                                 
-## 2. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pa
-## k")… at package.R:84:3                                                  
-## 3. err$throw(res$error) at subprocess.R:115:5                           
-## ---                                                                     
-## Subprocess backtrace:                                                   
-##  1. base::withCallingHandlers(cli_message = function(msg) \{ …           
-##  2. get("pkg_install_do_plan", asNamespace("pak"))(...)                 
-##  3. proposal$install()                                                  
-##  4. pkgdepends::install_package_plan(plan, lib = private$library, num_wo
-## rkers = nw…                                                             
-##  5. base::withCallingHandlers(\{ …                                       
-##  6. pkgdepends:::handle_events(state, events)                           
-##  7. pkgdepends:::handle_event(state, i)                                 
-##  8. pkgdepends:::stop_task(state, worker)                               
-##  9. pkgdepends:::stop_task_build(state, worker)                         
-## 10. base::throw(new_pkg_build_error("Failed to build source package \{pkg
-## \}", …                                                                   
-## 11. | base::signalCondition(cond)                                       
-## 12. global (function (e) …                                              
-## Execution halted                                                        
-
-}} -\if{html}{\out{ -
-}} - - -On the other hand, if you are installing binary packages, e.g. from the -Posit Package Manager, then the installation typically succeeds, but -then loading the package fails: - -\if{html}{\out{
}}\preformatted{pak::pkg_install("RPostgres") -library(RPostgres) -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## → Will install 17 packages.                                             
-## → All 17 packages (0 B) are cached.                                     
-## + DBI          1.1.3                                                    
-## + RPostgres    1.4.5   +  libpq-dev                                    
-## + Rcpp         1.0.10                                                   
-## + bit          4.0.5                                                    
-## + bit64        4.0.5                                                    
-## + blob         1.2.4                                                    
-## + cli          3.6.1                                                    
-## + generics     0.1.3                                                    
-## + glue         1.6.2                                                    
-## + hms          1.1.3                                                    
-## + lifecycle    1.0.3                                                    
-## + lubridate    1.9.2                                                    
-## + pkgconfig    2.0.3                                                    
-## + rlang        1.1.1                                                    
-## + timechange   0.2.0                                                    
-## + vctrs        0.6.2                                                    
-## + withr        2.5.0                                                    
-##  Missing 1 system package. You'll probably need to install it          
-## manually:                                                               
-## + libpq-dev  - RPostgres                                                
-##  No downloads are needed, 17 pkgs are cached                           
-##  Installed DBI 1.1.3  (1.1s)                                           
-##  Installed RPostgres 1.4.5  (1.1s)                                     
-##  Installed Rcpp 1.0.10  (1.2s)                                         
-##  Installed bit 4.0.5  (1.2s)                                           
-##  Installed bit64 4.0.5  (144ms)                                        
-##  Installed blob 1.2.4  (1.1s)                                          
-##  Installed cli 3.6.1  (1.1s)                                           
-##  Installed generics 0.1.3  (90ms)                                      
-##  Installed glue 1.6.2  (87ms)                                          
-##  Installed hms 1.1.3  (1.1s)                                           
-##  Installed lifecycle 1.0.3  (1.1s)                                     
-##  Installed lubridate 1.9.2  (1.1s)                                     
-##  Installed pkgconfig 2.0.3  (1.1s)                                     
-##  Installed rlang 1.1.1  (1.1s)                                         
-##  Installed timechange 0.2.0  (1.1s)                                    
-##  Installed vctrs 0.6.2  (1.1s)                                         
-##  Installed withr 2.5.0  (1.1s)                                         
-##  1 pkg + 16 deps: added 17 [11.6s]                                     
-## Error: package or namespace load failed for ‘RPostgres’ in dyn.load(file
-## , DLLpath = DLLpath, ...):                                              
-##  unable to load shared object '/tmp/RtmpWqZycA/lib/RPostgres/libs/RPostg
-## res.so':                                                                
-##   libpq.so.5: cannot open shared object file: No such file or directory 
-## Execution halted                                                        
-
-}} -\if{html}{\out{ -
-}} - -} -} - -\section{Other queries}{ -In addition to the automatic system package lookup and installation, pak -also has some other functions to help you with system dependencies. The -\code{sysreqs_db_list()} function lists all system requirements pak knows -about. - -\if{html}{\out{
}}\preformatted{pak::sysreqs_db_list() -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## # A data frame: 106 × 5                                                 
-##    name       patterns  packages  pre_install post_install              
-##    <chr>      <list>    <list>    <list>      <list>                    
-##  1 QuantLib   <chr [1]> <chr [1]> <NULL>      <NULL>                    
-##  2 apparmor   <chr [2]> <chr [1]> <NULL>      <NULL>                    
-##  3 atk        <chr [1]> <chr [1]> <NULL>      <NULL>                    
-##  4 automake   <chr [1]> <chr [1]> <NULL>      <NULL>                    
-##  5 berkeleydb <chr [2]> <chr [1]> <NULL>      <NULL>                    
-##  6 blender    <chr [1]> <chr [1]> <NULL>      <NULL>                    
-##  7 bowtie2    <chr [1]> <chr [1]> <NULL>      <NULL>                    
-##  8 bwidget    <chr [1]> <chr [1]> <NULL>      <NULL>                    
-##  9 cairo      <chr [1]> <chr [1]> <NULL>      <NULL>                    
-## 10 chrome     <chr [1]> <NULL>    <chr [3]>   <chr [1]>                 
-## # ℹ 96 more rows                                                        
-
-}} -\if{html}{\out{ -
-}} - - -\code{sysreqs_db_match()} manually matches \code{SystemREquirements} fields -againts these system requirements: - -\if{html}{\out{
}}\preformatted{sq <- pak::sysreqs_db_match("Needs libcurl and also Java.") -sq -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## [[1]]                                                                   
-## # A data frame: 2 × 5                                                   
-##   spec                         sysreq  packages pre_install post_install
-##   <chr>                        <chr>   <list>   <list>      <list>      
-## 1 Needs libcurl and also Java. java    <chr>    <NULL>      <chr [1]>   
-## 2 Needs libcurl and also Java. libcurl <chr>    <NULL>      <NULL>      
-##                                                                         
-
-}} -\if{html}{\out{ -
-}} - - -\if{html}{\out{
}}\preformatted{sq[[1]]$packages -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## [[1]]                                                                   
-## [1] "default-jdk"                                                       
-##                                                                         
-## [[2]]                                                                   
-## [1] "libcurl4-openssl-dev"                                              
-##                                                                         
-
-}} -\if{html}{\out{ -
-}} - - -You can also use it to query system requirements for other platfosm: - -\if{html}{\out{
}}\preformatted{sqrhel9 <- pak::sysreqs_db_match("Needs libcurl and also Java.", "redhat-9") -sqrhel9 -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## [[1]]                                                                   
-## # A data frame: 2 × 5                                                   
-##   spec                         sysreq  packages pre_install post_install
-##   <chr>                        <chr>   <list>   <list>      <list>      
-## 1 Needs libcurl and also Java. java    <chr>    <NULL>      <chr [1]>   
-## 2 Needs libcurl and also Java. libcurl <chr>    <NULL>      <NULL>      
-##                                                                         
-
-}} -\if{html}{\out{ -
-}} - - -\if{html}{\out{
}}\preformatted{sqrhel9[[1]]$packages -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## [[1]]                                                                   
-## [1] "java-11-openjdk-devel"                                             
-##                                                                         
-## [[2]]                                                                   
-## [1] "libcurl-devel"                                                     
-##                                                                         
-
-}} -\if{html}{\out{ -
-}} - - -\code{sysreqs_list_system_packages()} is a cross-platform way of listing all -installed system packages and capabilities: - -\if{html}{\out{
}}\preformatted{pak::sysreqs_list_system_packages() -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## # A data frame: 433 × 4                                                 
-##    status package         version         provides                      
-##    <chr>  <chr>           <chr>           <list>                        
-##  1 ii     adduser         3.118ubuntu5    <chr [0]>                     
-##  2 ii     apt             2.4.8           <chr [1]>                     
-##  3 ii     autoconf        2.71-2          <chr [0]>                     
-##  4 ii     automake        1:1.16.5-1.3    <chr [2]>                     
-##  5 ii     autotools-dev   20220109.1      <chr [0]>                     
-##  6 ii     base-files      12ubuntu4.3     <chr [1]>                     
-##  7 ii     base-passwd     3.5.52build1    <chr [0]>                     
-##  8 ii     bash            5.1-6ubuntu1    <chr [0]>                     
-##  9 ii     binutils        2.38-4ubuntu2.1 <chr [2]>                     
-## 10 ii     binutils-common 2.38-4ubuntu2.1 <chr [0]>                     
-## # ℹ 423 more rows                                                       
-
-}} -\if{html}{\out{ -
-}} - - -\code{sysreqs_check_installed()} is a handy function that checks if -all system requirements are installed for some or all R packages that -are installed in your library: - -\if{html}{\out{
}}\preformatted{pak::sysreqs_check_installed() -}\if{html}{\out{
}}\if{html}{\out{ -
-}} -\if{html}{\out{ -
-## system package       installed required by                              
-## --------------       --        -----------                              
-## git                           gitcreds                                 
-## gsfonts                       magick                                   
-## imagemagick                   magick                                   
-## libarchive-dev                archive                                  
-## libcurl4-openssl-dev          curl                                     
-## libfontconfig1-dev            systemfonts                              
-## libfreetype6-dev              ragg, systemfonts, textshaping           
-## libfribidi-dev                textshaping                              
-## libharfbuzz-dev               textshaping                              
-## libicu-dev                    stringi                                  
-## libjpeg-dev                   ragg                                     
-## libmagick++-dev               magick                                   
-## libnode-dev                   V8                                       
-## libpng-dev                    ragg                                     
-## libpq-dev                     RPostgres                                
-## libssl-dev                    curl, openssl                            
-## libtiff-dev                   ragg                                     
-## libxml2-dev                   xml2                                     
-## make                          fs, sass                                 
-## pandoc                        knitr, rmarkdown                         
-## zlib1g-dev                    data.table                               
-
-}} -\if{html}{\out{ -
-}} - - -\code{sysreqs_fix_installed()} goes one step further and also tries to install -the missing system requirements. -} - -\section{Build-time and run-time dependencies}{ -The system requirements database that pak uses does not currently -differentiate between build-time and run-time dependencies. A build-time -dependency is a system package that you need when \emph{installing} an R -package from source. A run-time dependency is a system package that you -need when \emph{using} an R package. Most Linux distribution create (at -least) two packages for each software library: a runtime package and a -development package. For an R package that uses such a software library, -the runtime package is a run-time dependency and the development package -is a build-time dependency. However, pak does not currently know the -difference between build-time and run-time dependencies, and it will -install both types of dependencies, always. This means that pak usually -installs system packages that are not strictly necessary. These are -typically development packages of libraries, i.e. header files, and -typically do not cause any issues. If you are short on disk space, then -you can try removing them. -} - -\section{How it works}{ -pak uses the database of system requirements at -\url{https://github.com/rstudio/r-system-requirements}. It has its own copy -of the database embedded into the package, and it also tries to download -updated versions of the database from GitHub, if its current copy is -older than one day. You can explicitly update the database from GitHub -using the \code{sysreqs_db_update()} function. - -For CRAN packages, it downloads the \code{SystemRequierements} fields from -\url{https://cran2.r-pkg.org/metadata/}, which is a database updated daily. -We are planning on moving this database to GitHub, and creating a -similar database for Bioconductor. - -For packages sources that require pak to obtain a package \code{DESCRIPTION} -file (e.g. \verb{github::}, \verb{git::}, etc.), pak obtrains \code{SystemRequirements} -directly from the \code{DESCRIPTION} file. - -Once having the \code{SystemRequirements} fields, pak matches them to the -database, to obtain the cacnonized list of system requirements. - -Then pak queries the local platform, to see the exact system packages -needed. It also queries the installed system packages, to avoid trying -to install system packages that are already installed. -} - -\section{Configuration}{ -There are several pak configuration options you can use to adjust how -system requirements are handled. We will list some of them here, please -see the options with a \code{sysreqs} prefix in the \code{?pak-config} manual page -for a complete and current list. -\itemize{ -\item \code{sysreqs}: whether to install system requirements. The default is -\code{TRUE} if the platform is supported and the user can install system -packages, either because it is the superuser, or via \code{sudo}. If it -is \code{FALSE} (or the user cannot install system packages), but the -platform is supported, system requirements are printed, but not -installed. -\item \code{sysreqs_db_update}: whether to try to update the system -requirements database from GitHub. -\item \code{sysreqs_db_update_timeout}: timeout for the system requirements -update from GitHub. -\item \code{sysreqs_dry_run}: if \code{TRUE} then pak only prints the install -commands, but does not actually run them. -\item \code{sysreqs_platform}: the platform name to use for determining system -requirements. Defaults to the current platform. If you are using a -Linux distribution that is compatible with some distribution that -pak supports, then you can set this option manually. E.g. -Ubuntu-based distros can set it to \code{ubuntu-22.04}, or the -appropriate Ubuntu version. -\item \code{sysreqs_sudo}: whether to use \code{sudo} to install system packages. If -this is not set, then pak tries to auto-detect if \code{sudo} is needed -or not. -\item \code{sysreqs_update}: whether to try to update system packages that are -already installed. pak does not know which version of a system -package is required, and it does not try to update system packages -by default. If you think that you need newer system packages, then -you can set this option to \code{TRUE}. -\item \code{sysreqs_verbose}: whether to print the output of the system package -installation commands. Useful for debugging, and it is \code{TRUE} by -default in a CI environment. -} -} - -\section{About other OSes}{ -\subsection{Windows}{ - -While the system requirements database has some information about system -dependencies on Windows, pak does not use this information and it does -not try to install system software on Windows. CRAN, PPM and -Bioconductor have Windows binary packages available for the majority of -R packages they serve, and these packages practically always link to -system libraries statically, so they don’t need any external software. - -If you wish to compile Windows packages from source, then you need to -install the appropriate version of Rtools, and possibly extra packages -using the \code{pacman} tool of Rtools4x. - -Rtools42 and newer Rtools versions bundle lots of libraries, so most -likely no extra \code{pacman} packages are needed. Rtools40 has a leaner -default installation, and you’ll probably need to install packages -manually: -\url{https://github.com/r-windows/docs/blob/master/rtools40.md#readme} - -We are planning on adding better Windows system software support to pak -in the future. -} - -\subsection{macOS}{ - -pak does not currently have system requirement information for macOS. -macOS is similar to Windows, in that most repositories will serve -statically linked macOS binary packages that do not need system -software. - -If you do need to compile packages from source, then you possibly need -to install some sytem libraries, either via Homebrew, or by downloading -CRAN’s static library builds from \url{https://mac.r-project.org/bin/} - -We are planning on adding better macOS system software support to pak in -the future. -} -} - diff --git a/man/sysreqs_check_installed.Rd b/man/sysreqs_check_installed.Rd index d229dcac1..983deb3d7 100644 --- a/man/sysreqs_check_installed.Rd +++ b/man/sysreqs_check_installed.Rd @@ -9,45 +9,41 @@ sysreqs_check_installed(packages = NULL, library = .libPaths()[1]) sysreqs_fix_installed(packages = NULL, library = .libPaths()[1]) } \arguments{ -\item{packages}{If not \code{NULL}, then only these packages are checked. -If a package in \code{packages} is not installed, then -pak throws a warning.} +\item{packages}{If not `NULL`, then only these packages are checked. +If a package in `packages` is not installed, then +`r pak_or_pkgdepends()` throws a warning.} \item{library}{Library or libraries to check.} } \value{ Data frame with a custom print and format method, and a -\code{pkg_sysreqs_check_result} class. Its columns are: -\itemize{ -\item \code{system_package}: string, name of the required system package. -\item \code{installed}: logical, whether the system package is correctly -installed. -\item \code{packages}: list column of character vectors. The names of the -installed R packages that need this system package. -\item \code{pre_install}: list column of character vectors. Commands to run -before the installation of the the system package. -\item \code{post_install}: list column of character vectors. Commands to run -after the installation of the system package. -} + `pkg_sysreqs_check_result` class. Its columns are: + * `system_package`: string, name of the required system package. + * `installed`: logical, whether the system package is correctly + installed. + * `packages`: list column of character vectors. The names of the + installed R packages that need this system package. + * `pre_install`: list column of character vectors. Commands to run + before the installation of the the system package. + * `post_install`: list column of character vectors. Commands to run + after the installation of the system package. The data frame also have two attributes with additional data: -\itemize{ -\item \code{sysreqs_records}: the raw system requirements records, and -\item \code{system_packages}: the list of the installed system packages. -} +* `sysreqs_records`: the raw system requirements records, and +* `system_packages`: the list of the installed system packages. -\code{sysreqs_fix_packages()} returns the same value, but invisibly. +`sysreqs_fix_packages()` returns the same value, but invisibly. } \description{ -\code{sysreqs_check_installed()} checks if the system requirements of all +`sysreqs_check_installed()` checks if the system requirements of all packages (or a subset of packages) are installed. -\code{sysreqs_fix_installed()} installs the missing system packages. +`sysreqs_fix_installed()` installs the missing system packages. } \details{ -These functions use the \code{sysreqs_platform} configuration option, +These functions use the `sysreqs_platform` configuration option, see \eval{man_config_link("Configuration")}. Set this if -pak does not detect your platform correctly. +`r pak_or_pkgdepends()` does not detect your platform correctly. } \examples{ \dontshow{if (Sys.getenv("IN_PKGDOWN") == "true" && Sys.info()[["sysname"]] == "Linux") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/sysreqs_db_list.Rd b/man/sysreqs_db_list.Rd index f615f2c9f..3080efab9 100644 --- a/man/sysreqs_db_list.Rd +++ b/man/sysreqs_db_list.Rd @@ -7,25 +7,23 @@ sysreqs_db_list(sysreqs_platform = NULL) } \arguments{ -\item{sysreqs_platform}{System requirements platform. If \code{NULL}, then the -\code{sysreqs_platform} \eval{man_config_link("configuration option")} +\item{sysreqs_platform}{System requirements platform. If `NULL`, then the +`sysreqs_platform` \eval{man_config_link("configuration option")} is used, which defaults to the current platform. Set this option if \eval{.packageName} does not detect your platform correctly.} } \value{ Data frame with columns: -\itemize{ -\item \code{name}: cross platform system dependency name in the database. -\item \code{patterns}: one or more regular expressions to match to -\code{SystemRequirements} fields. -\item \code{packages}: one or more system package names to install. -\item \code{pre_install}: command(s) to run before installing the packages. -\item \code{post_install}:: command(s) to run after installing the packages. -} +* `name`: cross platform system dependency name in the database. +* `patterns`: one or more regular expressions to match to + `SystemRequirements` fields. +* `packages`: one or more system package names to install. +* `pre_install`: command(s) to run before installing the packages. +* `post_install`:: command(s) to run after installing the packages. } \description{ It also tries to update the system dependency database, if it is -outdated. (I.e. older than allowed in the \code{metadata_update_after} +outdated. (I.e. older than allowed in the `metadata_update_after` \eval{man_config_link("configuration option")}. } \examples{ diff --git a/man/sysreqs_db_match.Rd b/man/sysreqs_db_match.Rd index 743811a22..eec2d2508 100644 --- a/man/sysreqs_db_match.Rd +++ b/man/sysreqs_db_match.Rd @@ -9,31 +9,29 @@ sysreqs_db_match(specs, sysreqs_platform = NULL) \arguments{ \item{specs}{Character vector of system requirements descriptions.} -\item{sysreqs_platform}{System requirements platform. If \code{NULL}, then the -\code{sysreqs_platform} \eval{man_config_link("configuration option")} +\item{sysreqs_platform}{System requirements platform. If `NULL`, then the +`sysreqs_platform` \eval{man_config_link("configuration option")} is used, which defaults to the current platform. Set this option if \eval{.packageName} does not detect your platform correctly.} } \value{ Data frame with columns: -\itemize{ -\item \code{spec}: the input \code{specs}. -\item \code{sysreq}: name of the system library or tool. -\item \code{packages}: system packages, list column of character vectors. -Rarely it can be an empty string, e.g. if a \code{pre_install} script -performs the installation. -\item \code{pre_install}: list column of character vectors. Shell script(s) to -run before the installation. -\item \code{post_install}: list column of character vectors. Shell script(s) to -run after the installation. -} +* `spec`: the input `specs`. +* `sysreq`: name of the system library or tool. +* `packages`: system packages, list column of character vectors. + Rarely it can be an empty string, e.g. if a `pre_install` script + performs the installation. +* `pre_install`: list column of character vectors. Shell script(s) to + run before the installation. +* `post_install`: list column of character vectors. Shell script(s) to + run after the installation. } \description{ -In the usual workflow pak matches the -\code{SystemRequirements} fields of the \code{DESCRIPTION} files to the database. +In the usual workflow `r pak_or_pkgdepends()` matches the +`SystemRequirements` fields of the `DESCRIPTION` files to the database. } \details{ -The \code{sysreqs_db_match()} function lets you match any string, and it is +The `sysreqs_db_match()` function lets you match any string, and it is mainly useful for debugging. } \examples{ diff --git a/man/sysreqs_db_update.Rd b/man/sysreqs_db_update.Rd index e742bfb5a..13da284ec 100644 --- a/man/sysreqs_db_update.Rd +++ b/man/sysreqs_db_update.Rd @@ -11,7 +11,7 @@ Update the cached copy of the system requirements database } \details{ If the the cached copy is recent, then no update is attempted. See the -\code{metadata_update_after} \eval{man_config_link("configuration option")}. +`metadata_update_after` \eval{man_config_link("configuration option")}. } \seealso{ Other system requirements functions: diff --git a/man/sysreqs_is_supported.Rd b/man/sysreqs_is_supported.Rd index b55c4bf83..53a6b445b 100644 --- a/man/sysreqs_is_supported.Rd +++ b/man/sysreqs_is_supported.Rd @@ -7,8 +7,8 @@ sysreqs_is_supported(sysreqs_platform = NULL) } \arguments{ -\item{sysreqs_platform}{System requirements platform. If \code{NULL}, then the -\code{sysreqs_platform} \eval{man_config_link("configuration option")} +\item{sysreqs_platform}{System requirements platform. If `NULL`, then the +`sysreqs_platform` \eval{man_config_link("configuration option")} is used, which defaults to the current platform. Set this option if \eval{.packageName} does not detect your platform correctly.} } @@ -24,8 +24,8 @@ sysreqs_is_supported() \dontshow{\}) # examplesIf} } \seealso{ -The \code{sysreqs_platform} -\eval{man_config_link("configuration option")}. +The `sysreqs_platform` + \eval{man_config_link("configuration option")}. Other system requirements functions: \code{\link{pkg_sysreqs}()}, diff --git a/man/sysreqs_list_system_packages.Rd b/man/sysreqs_list_system_packages.Rd index 40a5f9970..f8d03590a 100644 --- a/man/sysreqs_list_system_packages.Rd +++ b/man/sysreqs_list_system_packages.Rd @@ -8,23 +8,21 @@ sysreqs_list_system_packages() } \value{ Data frame with columns: -\itemize{ -\item \code{status}. two or three characters, the notation of \code{dpkg} on Debian -based systems. \code{"ii"} means the package is correctly installed. -On \code{RPM} based systems it is always \code{"ii"} currently. -\item \code{package}: name of the system package. -\item \code{version}: installed version of the system package. -\item \code{capabilities}: list column of character vectors, the capabilities -provided by the package. -} + * `status`. two or three characters, the notation of `dpkg` on Debian + based systems. `"ii"` means the package is correctly installed. + On `RPM` based systems it is always `"ii"` currently. + * `package`: name of the system package. + * `version`: installed version of the system package. + * `capabilities`: list column of character vectors, the capabilities + provided by the package. } \description{ List installed system packages } \details{ -This function uses the \code{sysreqs_platform} configuration option, +This function uses the `sysreqs_platform` configuration option, see \eval{man_config_link("Configuration")}. Set this if -pak does not detect your platform correctly. +`r pak_or_pkgdepends()` does not detect your platform correctly. } \examples{ \dontshow{if (Sys.getenv("IN_PKGDOWN") == "true" && Sys.info()[["sysname"]] == "Linux") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/sysreqs_platforms.Rd b/man/sysreqs_platforms.Rd index f2443073c..cde7e7d4f 100644 --- a/man/sysreqs_platforms.Rd +++ b/man/sysreqs_platforms.Rd @@ -8,17 +8,15 @@ sysreqs_platforms() } \value{ Data frame with columns: -\itemize{ -\item \code{name}: human readable OS name. -\item \code{os}: OS name, e.g. \code{linux}. -\item \code{distribution}: OS id, e.g. \code{ubuntu} or \code{redhat}. -\item \code{version}: distribution version. A star means that all versions are -supported, that are also supported by the vendor. -\item \code{update_command}: command to run to update the system package metadata. -\item \code{install_command}: command to run to install packages. -\item \code{query_command}: name of the tool to use to query system package -information. -} +* `name`: human readable OS name. +* `os`: OS name, e.g. `linux`. +* `distribution`: OS id, e.g. `ubuntu` or `redhat`. +* `version`: distribution version. A star means that all versions are + supported, that are also supported by the vendor. +* `update_command`: command to run to update the system package metadata. +* `install_command`: command to run to install packages. +* `query_command`: name of the tool to use to query system package + information. } \description{ List platforms with system requirements support diff --git a/man/system_r_platform.Rd b/man/system_r_platform.Rd index bb472c267..7b63065cf 100644 --- a/man/system_r_platform.Rd +++ b/man/system_r_platform.Rd @@ -10,67 +10,61 @@ system_r_platform() system_r_platform_data() } \value{ -\code{system_r_platform()} returns a character scalar. +`system_r_platform()` returns a character scalar. -\code{system_r_platform_data()} returns a data frame with character +`system_r_platform_data()` returns a data frame with character scalar columns: -\itemize{ -\item \code{cpu}, -\item \code{vendor}, -\item \code{os}, -\item \code{distribution} (only on Linux), -\item \code{release} (only on Linux), -\item \code{platform}: the concatenation of the other columns, separated by -a dash. -} + * `cpu`, + * `vendor`, + * `os`, + * `distribution` (only on Linux), + * `release` (only on Linux), + * `platform`: the concatenation of the other columns, separated by + a dash. } \description{ R platforms } \details{ -\code{system_r_platform()} detects the platform of the current R version. -\code{system_r_platform_data()} is similar, but returns the raw data instead +`system_r_platform()` detects the platform of the current R version. +`system_r_platform_data()` is similar, but returns the raw data instead of a character scalar. By default pak works with source packages and binary packages for the current platform. You can change this, by providing different -platform names in the \code{\link[=pak-config]{pkg.platforms}} option or the -\code{\link[=pak-config]{PKG_PLATFORMS}} environment variable. +platform names in the [`pkg.platforms`][pak-config] option or the +[`PKG_PLATFORMS`][pak-config] environment variable. This option may contain the following platform names: -\itemize{ -\item \code{"source"} for source packages, -\item \code{"macos"} for macOS binaries that are appropriate for the R versions -pak is working with. Packages for incompatible CPU architectures are -dropped (defaulting to the CPU of the current macOS machine and x86_64 on -non-macOS systems). The macOS Darwin version is selected based on the -CRAN macOS binaries. E.g. on R 3.5.0 macOS binaries -are built for macOS El Capitan. -\item \code{"windows"} for Windows binaries for the default CRAN architecture. -This is currently Windows Vista for all supported R versions, but it -might change in the future. The actual binary packages in the -repository might support both 32 bit and 64 builds, or only one of -them. In practice 32-bit only packages are very rare. CRAN builds -before and including R 4.1 have both architectures, from R 4.2 they -are 64 bit only. \code{"windows"} is an alias to \code{i386+x86_64-w64-mingw32} -currently. -\item A platform string like \code{R.version$platform}, but on Linux the name -and version of the distribution are also included. Examples: -\itemize{ -\item \code{x86_64-apple-darwin17.0}: macOS High Sierra. -\item \code{aarch64-apple-darwin20}: macOS Big Sur on arm64. -\item \code{x86_64-w64-mingw32}: 64 bit Windows. -\item \code{i386-w64-mingw32}: 32 bit Windows. -\item \code{i386+x86_64-w64-mingw32}: 64 bit + 32 bit Windows. -\item \code{i386-pc-solaris2.10}: 32 bit Solaris. (Some broken 64 Solaris -builds might have the same platform string, unfortunately.) -\item \code{x86_64-pc-linux-gnu-debian-10}: Debian Linux 10 on x86_64. -\item \verb{x86_64-pc-linux-musl-alpine-3.14.1}: Alpine Linux. -\item \code{x86_64-pc-linux-gnu-unknown}: Unknown Linux Distribution on x86_64. -\item \code{s390x-ibm-linux-gnu-ubuntu-20.04}: Ubuntu Linux 20.04 on S390x. -\item \code{amd64-portbld-freebsd12.1}: FreeBSD 12.1 on x86_64. -} -} +* `"source"` for source packages, +* `"macos"` for macOS binaries that are appropriate for the R versions + pak is working with. Packages for incompatible CPU architectures are + dropped (defaulting to the CPU of the current macOS machine and x86_64 on + non-macOS systems). The macOS Darwin version is selected based on the + CRAN macOS binaries. E.g. on R 3.5.0 macOS binaries + are built for macOS El Capitan. +* `"windows"` for Windows binaries for the default CRAN architecture. + This is currently Windows Vista for all supported R versions, but it + might change in the future. The actual binary packages in the + repository might support both 32 bit and 64 builds, or only one of + them. In practice 32-bit only packages are very rare. CRAN builds + before and including R 4.1 have both architectures, from R 4.2 they + are 64 bit only. `"windows"` is an alias to `i386+x86_64-w64-mingw32` + currently. +* A platform string like `R.version$platform`, but on Linux the name + and version of the distribution are also included. Examples: + - `x86_64-apple-darwin17.0`: macOS High Sierra. + - `aarch64-apple-darwin20`: macOS Big Sur on arm64. + - `x86_64-w64-mingw32`: 64 bit Windows. + - `i386-w64-mingw32`: 32 bit Windows. + - `i386+x86_64-w64-mingw32`: 64 bit + 32 bit Windows. + - `i386-pc-solaris2.10`: 32 bit Solaris. (Some broken 64 Solaris + builds might have the same platform string, unfortunately.) + - `x86_64-pc-linux-gnu-debian-10`: Debian Linux 10 on x86_64. + - `x86_64-pc-linux-musl-alpine-3.14.1`: Alpine Linux. + - `x86_64-pc-linux-gnu-unknown`: Unknown Linux Distribution on x86_64. + - `s390x-ibm-linux-gnu-ubuntu-20.04`: Ubuntu Linux 20.04 on S390x. + - `amd64-portbld-freebsd12.1`: FreeBSD 12.1 on x86_64. } \examples{ \dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} @@ -79,6 +73,6 @@ system_r_platform_data() \dontshow{\}) # examplesIf} } \seealso{ -These function call \code{\link[pkgcache:current_r_platform]{pkgcache::current_r_platform()}} and -\code{\link[pkgcache:current_r_platform]{pkgcache::current_r_platform_data()}}. +These function call [pkgcache::current_r_platform()] and +[pkgcache::current_r_platform_data()]. }