View source: R/writeSelectionCHK.R
writeSelectionCHK | R Documentation |
RSMinerve writes result files or performs plots for a selection of variables.
This selection can be stored in and loaded to RSMInerve from a chk file. The
function writeSelectionCHK
writes such a file from a tibble.
writeSelectionCHK(filepath, data, name)
filepath |
Path to file to be written. |
data |
Tibble or data frame with description of variables to be written. |
name |
A character string for the name of the selection. |
The chk file is structured as shown in the following example:
<?xml version="1.0" encoding="utf-8"?>
<Selection>
<Name>New selection</Name>
<Path>Model Koksu\Source QSpring\Kichkinesay - QUp (m3/s)</Path>
<Path>Model Koksu\Comparator Comparator 1\QReference (m3/s)</Path>
<Path>Model Koksu\Comparator Comparator 1\QSimulation (m3/s)</Path>
...
The content of the Path parts is parsed from a tibble with columns Model,
Object, ID and Variable. The input tibble of the example above would be:
A tibble: 94 x 3
Model Object Variable
<chr> <chr> <chr>
Model Koksu Source QSpring Kichkinesay - QUp (m3/s)
Model Koksu Comparator Comparator 1 QReference (m3/s)
Model Koksu Comparator Comparator 1 QSimulation (m3/s)
... ... ...
NULL if successful.
Other RS Minerve IO:
getChunkSize()
,
load_minerve_input_csv()
,
readDBCSV()
,
readForcingCSV()
,
readForcingSTR()
,
readRSMParameters()
,
readResultCSV()
,
readResultDST()
,
readSelectionCHK()
,
translateCSVtoDST()
,
writeRSMParameters()
## Not run: filepath <- normalizePath(file.path("test_writeSelectionCHK.chk")) Object_IDs <- c("SOCONT 1", "SOCONT 2", "SOCONT 3") data <- tibble::tibble( Model = rep("Tutorial_Model", length(Object_IDs)), Object = rep("SOCONT", length(Object_IDs)), ID = Object_IDs, Variable = rep("Qtot (m3/s)") ) name <- "SOCONT Qtot" writeSelectionCHK(filepath, data, name) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.