A package resource is a resource for producing package information. Package resources can vary from source code repositories to R package repository listings. Each resources should be able to produce a downloadable version of executable package code, but the extent of included code might vary depending on source.
Usage
resource(
package = NA_character_,
version = NA_character_,
id = next_id(),
md5 = NA_character_
)
Arguments
- package
character(1L)
Package name. Optional, but should be provided if possible.- version
character(1L)
Package version, provided as a string.- id
integer(1L)
optional id used for tracking resources throughout execution. Generally not provided directly, as new objects automatically get a unique identifier. For example, the package source code from arepo_resource()
may be downloaded to add asource_archive_resource()
and add it to a newmulti_resource()
. Because all of these represent the same package, they retain the sameid
. Primarily theid
is used for isolating temporary files.- md5
character(1L)
md5 digest of the package source code tarball. This is not generally provided directly, but is instead derived when acquiring resources.
Details
Package resources should also implement convert()
, providing a method for
converting into a more desirable source of information. For example, given
only a listing of a package in a repository, calling convert()
on such
a reference may populate a local directory with the source code of the
package.
See also
Other resources:
cran_repo_resource()
,
git_resource()
,
install_resource()
,
local_resource()
,
local_source_resource()
,
mock_resource()
,
multi_resource()
,
remote_resource()
,
repo_resource()
,
source_archive_resource()
,
source_code_resource()
,
unknown_resource()