SpaDES (version 1.1.4)

defineModule: Define a new module.

Description

Specify a new module's metadata as well as object and package dependecies. Packages are loaded during this call.

Usage

defineModule(sim, x)

## S3 method for class '.simList,list': defineModule(sim, x)

Arguments

sim
A simList object.
x
A named list containing the parameters used to construct a new .moduleDeps object.

Value

  • Updated simList object.

Required metadata elements

ll{ name Module name. Must match the filename (without the .R extension). description Brief description of the module. keywords Author-supplied keywords. childModules Names of child modules. Can be NA. authors Module author information (as a vector of person objects. version Module version number (will be coerced to numeric_version if a character or numeric are supplied). spatialExtent The spatial extent of the module supplied via raster::extent. timeframe Vector (length 2) of POSIXt dates specifying the temporal extent of the module. timeunit Time scale of the module (e.g., "day", "year"). citation List of character strings specifying module citation information. Alternatively, a list of filenames of .bib or similar files. documentation List of filenames refering to module documentation sources. reqdPkgs List of R package names required by the module. parameters A data.frame specifying the parameters used in the module. Usually produced by rbind-ing the outputs of multiple defineParameter calls. inputObjects A data.frame specifying the data objects required as inputs to the module, with columns objectName, objectClass, sourceURL, and other. outputObjects A data.frame specifying the data objects output by the module, with columns identical to those in inputObjects. }

Examples

Run this code
moduleInfo <- list(...)
  defineModule(sim, moduleInfo)

Run the code above in your browser using DataLab