Public methods
Method new()
Create a new pkg_download_proposal
object. Consider using
new_pkg_download_proposal()
instead of calling the constructor
directly.
The returned object can be used to look up (recursive) dependencies
of R packages from various sources, and then to download the
package files.
Usage
pkg_download_proposal$new(refs, config = list(), remote_types = NULL)
Arguments
refs
Package names or references. See
'Package references' for the syntax.
config
Configuration options, a named list. See
'Configuration'.
remote_types
Custom remote ref types, this is for advanced
use, and experimental currently.
Examples
pdl <- pkg_download_proposal$new("r-lib/pkgdepends")
pdl
Method get_refs()
The package refs that were used to create the
pkg_download_proposal
object.
Usage
pkg_download_proposal$get_refs()
Returns
A character vector of package refs that were used to create the
pkg_download_proposal
object.
Method get_config()
Configuration options for the pkg_download_proposal
object. See
'Configuration' for details.
Usage
pkg_download_proposal$get_config()
Returns
Named list. See 'Configuration' for the configuration
options.
Method resolve()
Resolve the dependencies of the specified package references. This
usually means downloading metadata from CRAN and Bioconductor,
unless already cached, and also from GitHub if GitHub refs were
included, either directly or indirectly. See
'Dependency resolution' for details.
Usage
pkg_download_proposal$resolve()
Returns
The pkg_download_proposal
object itself, invisibly.
Method async_resolve()
The same as resolve()
, but asynchronous.
This method is for advanced use.
Usage
pkg_download_proposal$async_resolve()
Returns
A deferred value.
Method get_resolution()
Query the result of the dependency resolution. This method can be
called after resolve()
has completed.
Usage
pkg_download_proposal$get_resolution()
Returns
A pkg_resolution_result object, which is also a data frame. See
'Dependency resolution' for its columns.
Method download()
Download all resolved packages. It uses the package cache in the
pkgcache package by default, to avoid downloads if possible.
Usage
pkg_download_proposal$download()
Returns
The pkg_download_proposal
object, invisibly.
Method async_download()
The same as download()
, but asynchronous.
This method is for advanced use.
Usage
pkg_download_proposal$async_download()
Returns
A deferred value.
Method get_downloads()
Returns the summary of the package downloads.
Usage
pkg_download_proposal$get_downloads()
Returns
A pkg_download_result object, which is a list. See
pkg_download_result for details.
Method stop_for_download_error()
Throw and error if the some of the downloads have failed for the
most recent
pkg_download_proposal$download()
call.
Usage
pkg_download_proposal$stop_for_download_error()
Method format()
Format a pkg_download_proposal
object, typically for printing.
Usage
pkg_download_proposal$format(...)
Arguments
...
not used currently.
Returns
Nothing.
A character vector, each element should be a line in the printout.
Method print()
Prints a pkg_download_proposal
object to the screen. The printout
includes:
The package refs.
Whether the object has the resolved dependencies.
Whether the resolution had errors.
Whether the downloads were completed.
Whether the downloads had errors.
Advice on which methods to call next.
See the example below.
Usage
pkg_download_proposal$print(...)
Arguments
...
not used currently.
Returns
The pkg_download_proposal
object itself, invisibly.
Method clone()
The objects of this class are cloneable with this method.
Usage
pkg_download_proposal$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.