readSelectionCHK: Reads a chk file containing the variables selected for...

View source: R/readSelectionCHK.R

readSelectionCHKR Documentation

Reads a chk file containing the variables selected for printing

Description

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 readSelectionCHK reads such a file to a tibble.

Usage

readSelectionCHK(filepath)

Arguments

filepath

Path to file to be read.

Details

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 to a tibble with columns Model, Object, ID and Variable. The output 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)
... ... ...

Value

A list with the name of the selection and the content of the Paths in the chk file as a tibble.

See Also

Other RS Minerve IO: getChunkSize(), load_minerve_input_csv(), readDBCSV(), readForcingCSV(), readForcingSTR(), readRSMParameters(), readResultCSV(), readResultDST(), translateCSVtoDST(), writeRSMParameters(), writeSelectionCHK()

Examples

## Not run: 
filepath <- normalizePath(file.path("test_selection.chk"))
selection_list <- readSelectionCHK(filepath)
selection_name <- selection_list[[1]]
selection_data <- selection_list[[2]]

## End(Not run)

hydrosolutions/riversCentralAsia documentation built on Feb. 7, 2023, 4:50 p.m.