runBaseline: Run a StoX baseline model

Description Usage Arguments Value Examples

View source: R/rstox_base.r

Description

runBaseline runs a StoX baseline model possibily overriding parameters.

getBaseline returns input and output data from the StoX baseline model.

Usage

1
2
3
4
5
6
7
8
runBaseline(projectName, startProcess = 1, endProcess = Inf,
  reset = FALSE, save = FALSE, out = c("project", "baseline", "report",
  "name"), modelType = "baseline", msg = TRUE, exportCSV = FALSE,
  warningLevel = 0, parlist = list(), ...)

getBaseline(projectName, input = c("par", "proc"), proc = "all",
  drop = TRUE, modelType = "baseline", msg = TRUE, startProcess = 1,
  endProcess = Inf, reset = FALSE, save = FALSE, parlist = list(), ...)

Arguments

projectName

The name or full path of the project, a baseline object (as returned from getBaseline or runBaseline, og a project object (as returned from openProject).

startProcess

The name or number of the start process in the list of processes in the model (run runBaseline to get the processes of the project). The use of startProcess and endProcess requres that either no processes in the given range of processes depends on processes outside of the range, or that a baseline object is given in the input.

endProcess

The name or number of the end process in the list of processes in the model.

reset

Logical; if TRUE rerun the baseline model even if it has been run previously.

save

Logical; if TRUE changes to the project specified in parlist and "..." are saved in Java and to the object javaParameters in the project list in the RstoxEnv environment.

out

The object to return from runBaseline(), one of "name" (projectName), "baseline" (Java baseline object) or "project" (Java project object, containing the baseline object). First element used.

modelType

The type of model to run, currently one of "baseline" and "report" (the latter referring to "baseline report"). First element used.

msg

Logical: if TRUE print information about the progress of reading the data.

exportCSV

Logical: if TRUE turn on exporting csv files from the baseline run.

warningLevel

The warning level used in the baseline run, where 0 stops the baseline for Java warnings, and 1 continues with a warning.

parlist

List of parameters values overriding existing parameter values. These are specified as processName = list(parameter = value), for example AcousticDensity = list(a = -70, m = 10), BioStationWeighting = list(WeightingMethod = "NASC", a = -70, m = 10). Logical parameters (given as strings "true"/"false" in StoX) can be given as logical TRUE/FALSE.

...

Same as parlist, but can be specified separately (not in a list but as separate inputs).

input

The input data requested in getBaseline(). This is a string vector naming baseline processes and process data. The key words "par" and "proc" returns all parameters and process data, respectively.

proc

A string vector naming processes from which data should be returned.

drop

Logical: if TRUE drop empty list elements (default).

par

A list of the same length as fun giving parameter values to uniquely identify processes. The list names are the names of the baseline process parameters, and the values are the baseline process values.

Value

For runBaseline theproject name, and for getBaseline a list of three elements named "parameters", "outputData", "processData", where empty elements can be dropped.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Get output from the baseline:
projectName <- "Test_Rstox"
system.time(baselineData <- getBaseline(projectName))
# Check the structure of the output from getBaseline():
ls.str(baselineData)

# Override parameters in the baseline:
system.time(baselineDataMod <- getBaseline(projectName, 
    AcousticDensity = list(a = -70, m = 10),
    BioStationWeighting = list(WeightingMethod = "NASC", Radius=100, a = -70, m = 10)))

# Check differences in parameters and data saved by the baseline model:
all.equal(baselineData, baselineDataMod)

Sea2Data/Rstox documentation built on April 18, 2018, 11:11 p.m.