read_ini: Read Hector INI file into list

Description Usage Arguments Value Author(s) Examples

View source: R/read_ini.R

Description

Read Hector INI file into list

Usage

1
2

Arguments

file

Path to INI file

parse_timeseries

Logical. If TRUE (default), use parse_timeseries() to convert time series value names (e.g. "Ftalbedo[1980]") to a data.frame. If FALSE, use the full string (with year included) as the key name.

normalize_paths

Logical. If TRUE (default), convert any relative paths in the INI file to full, normalized paths, following the same logic as the Hector internals (if the file exists relative to the working directory, use that file. Otherwise, look for the path in base_dir). If FALSE, leave the paths exactly as written.

base_dir

Path to directory to search for any relative paths, if normalize_paths is TRUE. Defaults to the directory in which the INI file is stored.

Value

Nested list of the target object

Author(s)

Alexey Shiklomanov

Examples

1
2
3
4
5
6
7
rcp45_ini <- read_ini(
  system.file("input", "hector_rcp45.ini", package = "hector")
)
rcp45_ini$core$run_name
rcp45_ini$onelineocean$enabled
# This one will be a `data.frame`
rcp45_ini$simpleNbox$Ftalbedo

JGCRI/hectortools documentation built on March 31, 2020, 4:44 p.m.