-
Notifications
You must be signed in to change notification settings - Fork 1
/
CBM_defaults.Rmd
94 lines (71 loc) · 2.6 KB
/
CBM_defaults.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
title: "CBM_defaults"
author: ""
date: "19 January 2018"
output: pdf_document
editor_options:
chunk_output_type: console
---
# CBM_defaults
## 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.
## Usage
```{r module_deafults_usage, eval=FALSE}
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)
```
```{r tests, eval=FALSE}
# The spades call should make a "dataset" class object
testthat::expect_true(is(outSim@.envir$cbmData, "dataset"))
```
## Events
Describe what happens for each event type.
### Plotting
Write what is plotted.
### Saving
Write what is saved.
## Data dependencies
### Input data
How to obtain input data, and a description of the data required by the module.
If `sourceURL` is specified, `downloadData("CBM_defaults", "path/to/modules/dir")` may be sufficient.
### Output data
Description of the module outputs.
## Links to other modules
Describe any anticipated linkages to other modules.