Derive a pkg
data field, giving a function by which a piece of package
data is calculated. This function is not called directly, it used by the
indexing functions implemented for pkg
to populate new data fields.
Default implementations accept field
as a character
, automatically
dispatching on the field as a class object, and accept a missing
resource
, instead iterating through pkg
resources by priority.
Arguments
- pkg
A
pkg()
- resource
A
resource()
, or if not provided, theresource
extracted frompkg@resource
.- field
Used for dispatching on which field to derive. Methods are provided such that a simple
character
field name can be passed and used to build a class for dispatching to the right derivation function.- ...
Used by specific methods.
Details
This function is used internally when accessing a pkg
object using $
,
[[
and [
.
See also
Other generics:
pkg_data_info()