R/rvn_rvi_write_template.R
rvn_rvi_write_template.RdWrites a Raven rvi file based on one of several template model configurations.
rvn_rvi_write_template(
template_name = "UBCWM",
filename = NULL,
overwrite = TRUE,
writeheader = TRUE,
filetype = "rvi ASCII Raven",
author = "RavenR",
description = NULL
)name of the model template to be written (default 'UBCWM')
Name of the rvi file, with extension (optional)
boolean whether to overwrite file if it already exists (default FALSE)
boolean whether to write a header to the rvi file (default TRUE)
File extension, Encoding, Raven version (e.g. "rvp ASCII Raven v3.8") (optional)
Name of file author (optional)
File Description for header (e.g., Basin or project information, R script name) (optional)
returns TRUE if executed successfully
Raven has the capability of emulating a number of existing model configurations, and a number of additional novel model configurations are provided which may be helpful to the user. These can be written with this function for ease of getting started with a model using Raven.
The template_name parameter should be one of "UBCWM", "HBV-EC", "HBV-Light", "GR4J", "CdnShield", "MOHYSE", "HMETS", "HYPR", "HYMOD", "SAC-SMA", "blended", or "blended_v2".
This function uses the same model template files that are provided in the Raven User's manual, Appendix D.
The rvn_write_Raven_newfile is used to write a header in the rvi file. Writing of a header
can be disabled with writeheader=FALSE.
# write the Canadian Shield configuration to 'mymodel.rvi'
rvn_rvi_write_template(template_name="CdnShield",
filename=file.path(tempdir(), "mymodel.rvi"))
#> [1] TRUE
# write the HMETS model with some additional details in the description
rvn_rvi_write_template(template_name="HMETS",
filename=file.path(tempdir(), "mynewmodel.rvi"),
author="Robert Chlumsky",
description="RVI file for the HMETS model (Martel, 2017) created by RavenR")
#> [1] TRUE