2 CBM_defaults
2.1 Overview
This module can run independently by running the global script below.
Its main task is to read-in all the default values in SpaDES-CBM which is akin to the ArchiveIndex
in CBM-CFS3 runs.
2.2 Usage
if (!require("remotes")) {
install.packages("remotes")
}
remotes::install_github("PredictiveEcology/Require@development")
remotes::install_github("PredictiveEcology/CBMutils@development")
library(Require)
Require("PredictiveEcology/SpaDES.project@transition", require = FALSE)
Require(c("SpaDES.core (>=1.1.0)", "SpaDES.tools (>= 1.0.0)",
"googledrive", 'RCurl', 'XML'),
#unlist(unname(packagesNeededInModules))),
require = "SpaDES.core", # call `require` only on this package (same as `library`)
verbose = 1)
cacheDir <- reproducible::checkPath("cache", create = TRUE)
moduleDir <- "modules"
inputDir <- reproducible::checkPath("inputs", create = TRUE)
outputDir <- reproducible::checkPath("outputs", create = TRUE)
setPaths(inputPath = inputDir,
modulePath = moduleDir,
outputPath = outputDir,
cachePath = cacheDir)
times <- list(start = 0, end = 10)
parameters <- list(
#.progress = list(type = "text", interval = 1), # for a progress bar
## If there are further modules, each can have its own set of parameters:
#module1 = list(param1 = value1, param2 = value2),
#module2 = list(param1 = value1, param2 = value2)
)
modules <- list("CBM_defaults")
objects <- list()
paths <- list(
cachePath = cacheDir,
modulePath = moduleDir,
inputPath = inputDir,
outputPath = outputDir
)
myDefaults <- simInit(times = times, params = parameters, modules = modules,
objects = objects, paths = paths)
outDefaults <- spades(myDefaults)
# The spades call should make a "dataset" class object
testthat::expect_true(is(outSim@.envir$cbmData, "dataset"))