Write SWAT+ input file, which has a tabular structure.
Usage
write_tbl(tbl, file_path, fmt)
Arguments
- tbl
SWAT input table in tibble (data.frame) format.
- file_path
Write path of the SWAT+ input file.
- fmt
Character vector of format strings to define the print format of
each table column.
Value
Writes a text file table in the file path.
Examples
if (FALSE) {
## Read the hydrology.hyd input file
hydrology_hyd <- read_tbl(paste0(model_path, '/hydrology.hyd'))
hydrology_hyd$esco <- 1
## Updating hydrology.hyd file
hydr_hyd_fmt <- c('%-16s', rep('%12.5f', 14))
write_tbl(hydrology_hyd, paste0(model_path, '/hydrology.hyd'), hydr_hyd_fmt)
}