metadata: Extract element from SpaDES module metadata

packagesInModulesR Documentation

Extract element from SpaDES module metadata

Description

Parses module code, looking for the metadataItem (default = "reqdPkgs") element in the defineModule function.

Usage

packagesInModules(modules, modulePath = getOption("spades.modulePath"))

metadataInModules(
  modules,
  metadataItem = "reqdPkgs",
  modulePath = getOption("spades.modulePath"),
  needUnlist,
  verbose = getOption("Require.verbose", 1L)
)

Arguments

modules

character vector of module names

modulePath

path to directory containing the module(s) named in modules

metadataItem

character identifying the metadata field to extract

needUnlist

logical indicating whether to unlist the resulting metadata look up

verbose

Numeric or logical indicating how verbose should the function be. If -1 or -2, then as little verbosity as possible. If 0 or FALSE, then minimal outputs; if 1 or TRUE, more outputs; 2 even more. NOTE: in Require function, when verbose >= 2, also returns details as if returnDetails = TRUE (for backwards compatibility).

Value

A character vector of sorted, unique packages that are identified in all named modules, or if modules is omitted, then all modules in modulePath.


PredictiveEcology/SpaDES.project documentation built on Dec. 23, 2024, 7:33 a.m.