Learn R Programming

SpaDES.core (version 0.2.4)

moduleMetadata: Parse and extract module metadata

Description

Parse and extract module metadata

Usage

moduleMetadata(sim, module, path)

# S4 method for missing,character,character moduleMetadata(module, path)

# S4 method for missing,character,missing moduleMetadata(module)

# S4 method for ANY,ANY,ANY moduleMetadata(sim, module, path)

Arguments

sim

A simList simulation object, generally produced by simInit.

module

Character string. Your module's name.

path

Character string specifying the file path to modules directory. Default is to use the spades.modulePath option.

Value

A list of module metadata, matching the structure in defineModule.

See Also

defineModule

Examples

Run this code
# NOT RUN {
path <- system.file("sampleModules", package = "SpaDES.core")
sampleModules <- dir(path)
# turn off code checking -- don't need it here
opts <- options("spades.moduleCodeChecks" = FALSE,
                "spades.useRequire" = FALSE)

x <- moduleMetadata(sampleModules[3], path = path)

# using simList
mySim <- simInit(
   times = list(start = 2000.0, end = 2001.0, timeunit = "year"),
   params = list(
     .globals = list(stackName = "landscape")
   ),
   modules = list("caribouMovement"),
   paths = list(modulePath = system.file("sampleModules", package = "SpaDES.core"))
)
moduleMetadata(sim = mySim)

# turn code checking back on -- don't need it here
options(opts)
# }

Run the code above in your browser using DataLab