Read default configuration of the package and complete it with eventual user config
loadConfig.Rd
Read default configuration of the package and complete it with eventual user config
Usage
loadConfig(
sic_path = NULL,
xml_path = NULL,
userFile = "config.yml",
pathDefaultCfg = system.file("config.yml", package = "rsic2")
)
Value
A configuration as it is returned by config::get. Configuration of RSIC2 as the following structure:
sic
path
: Path of local SIC installation (should be defined bysic_path
parameter or in the user config file)edisic
: sub-path to EdiSIC programtalweg
: sub-path to TALWEG programfluvia
: sub-path to FLUVIA programsirene
: sub-path to SIRENE programexport
: sub-path to SicExport programfortran
:prms
:INTERF
: defaultINTERF
parameter injected in command line arguments of TALWEG, FLUVIA, SIRENE
project
path
: Path to the XML project file (should be defined byxml_path
parameter or in the user config file)stricklers
: A vector of 2 numeric values representing respectively the default minor and medium bed Strickler coefficients to apply with sic_import_reaches
Details
The path to SIC and to the XML project file can be defined in the user XML file by defining the appropriate items:
sic:
path: Path/To/SIC/installation
project:
path: Path/To/Xml/Project/File.xml
Moreover, the sic_path
can be defined with the environment variable "SICPATH".
This setting is a default which is overwritten by the path defined in the user YAML file,
which is also overwritten by the one define by the sic_path
argument.
Examples
library(rsic2)
sic_path <- tempdir(check = TRUE)
xml_path <- R.utils::tmpfile()
cfg <- loadConfig(sic_path, xml_path)
str(cfg)
#> List of 2
#> $ sic :List of 7
#> ..$ fortran:List of 1
#> .. ..$ prms:List of 1
#> .. .. ..$ INTERF: chr "0"
#> ..$ path : chr "C:\\Users\\DAVID~1.DOR\\AppData\\Local\\Temp\\Rtmp80xC7T"
#> ..$ edisic : chr "exe/EdiSIC.exe"
#> ..$ talweg : chr "exe/TALWEG.exe"
#> ..$ fluvia : chr "exe/FLUVIA.exe"
#> ..$ sirene : chr "exe/SIRENE.exe"
#> ..$ export : chr "exe/SicExport.exe"
#> $ project:List of 2
#> ..$ path : chr "C:\\Users\\DAVID~1.DOR\\AppData\\Local\\Temp\\Rtmp80xC7T\\file3ca062052d47"
#> .. ..- attr(*, "gc")=<environment: 0x000000003712aa38>
#> ..$ stricklers: int [1:2] 40 40
#> - attr(*, "config")= chr "default"
#> - attr(*, "file")= chr "C:\\Users\\david.dorchies\\AppData\\Local\\Temp\\RtmpsD6aZ8\\temp_libpath257077564f2a\\rsic2\\config.yml"