new_pkg_download_proposal | R Documentation |
Download packages with their dependencies, from various sources.
new_pkg_download_proposal(refs, ...)
refs |
Package names or references. See 'Package references' for the syntax. |
... |
Additional arguments, passed to
|
new_pkg_download_proposal()
creates a new object from the
pkg_download_proposal
class, that can be used to look up and download
R packages and their dependencies. The advantage of
new_pkg_download_proposal()
compared to using the
pkg_download_proposal constructor directly is that it avoids making
pkgdepends a build time dependency.
Typical workflow to download a set of packages:
Create a pkg_download_proposal
object with
new_pkg_download_proposal()
.
Resolve all possible dependencies with
pkg_download_proposal$resolve()
.
Download all files with
pkg_download_proposal$download()
.
Get the data about the packages and downloads with
pkg_download_proposal$get_downloads()
.
new_pkg_download_proposal()
returns a new
pkg_download_proposal
object.
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.
pkg_download_proposal$new(refs, config = list(), remote_types = NULL)
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.
pdl <- pkg_download_proposal$new("r-lib/pkgdepends") pdl
get_refs()
The package refs that were used to create the
pkg_download_proposal
object.
pkg_download_proposal$get_refs()
A character vector of package refs that were used to create the
pkg_download_proposal
object.
get_config()
Configuration options for the pkg_download_proposal
object. See
'Configuration' for details.
pkg_download_proposal$get_config()
Named list. See 'Configuration' for the configuration options.
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.
pkg_download_proposal$resolve()
The pkg_download_proposal
object itself, invisibly.
async_resolve()
The same as resolve()
, but asynchronous.
This method is for advanced use.
pkg_download_proposal$async_resolve()
A deferred value.
get_resolution()
Query the result of the dependency resolution. This method can be
called after resolve()
has completed.
pkg_download_proposal$get_resolution()
A pkg_resolution_result object, which is also a data frame. See 'Dependency resolution' for its columns.
download()
Download all resolved packages. It uses the package cache in the pkgcache package by default, to avoid downloads if possible.
pkg_download_proposal$download()
The pkg_download_proposal
object, invisibly.
async_download()
The same as download()
, but asynchronous.
This method is for advanced use.
pkg_download_proposal$async_download()
A deferred value.
get_downloads()
Returns the summary of the package downloads.
pkg_download_proposal$get_downloads()
A pkg_download_result object, which is a list. See pkg_download_result for details.
stop_for_download_error()
Throw and error if the some of the downloads have failed for the
most recent
pkg_download_proposal$download()
call.
pkg_download_proposal$stop_for_download_error()
format()
Format a pkg_download_proposal
object, typically for printing.
pkg_download_proposal$format(...)
...
not used currently.
Nothing. A character vector, each element should be a line in the printout.
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.
pkg_download_proposal$print(...)
...
not used currently.
The pkg_download_proposal
object itself, invisibly.
clone()
The objects of this class are cloneable with this method.
pkg_download_proposal$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Method get_refs()
pdl <- new_pkg_download_proposal(c("pak", "jsonlite"))
pdl$get_refs()
# Method get_config()
pdl <- new_pkg_download_proposal("pak")
pdl$get_config()
# Method resolve()
pdl <- new_pkg_download_proposal("pak")
pdl$resolve()
pdl$get_resolution()
# Method get_resolution()
pdl <- new_pkg_download_proposal("r-lib/pkgdepends")
pdl$resolve()
pdl$get_resolution()
# Method download()
pdl <- new_pkg_download_proposal("r-lib/pkgdepends")
pdl$resolve()
pdl$download()
pdl$get_downloads()
# Method get_downloads()
pdl <- new_pkg_download_proposal("pkgload")
pdl$resolve()
pdl$download()
pdl$get_downloads()
# Method print()
pdl <- new_pkg_download_proposal("r-lib/pkgdepends")
pdl
pdl$resolve()
pdl
pdl$download()
pdl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.