SpecificValueInFile: Straightforward modification of a value in input text file

View source: R/ParameterValues2InputFiles.R

SpecificValueInFileR Documentation

Straightforward modification of a value in input text file

Description

This function provides the capability to modify input text files directly within the R environment, requering only minimal instructions. It was conceived to facilitate users to execute the calibration procedure via hydroMOPSO(), while staying entirely within the R environment. Thus, it precludes the need for manually editing text files, eliminating undesirable coordination that could potentially lead to errors.

Usage

SpecificValueInFile(modlist)

Arguments

modlist

(list)
A list with as many objects as modifications to be made in the text files. In turn, each object is a list with the specifications of the modification to be made. See ‘Details’ for the contents of each list.

Details

The modlist argument is a list with an indeterminate number of objects, which only depends on the number of modifications the user needs to make, for example, being something like modlist=list(mod_1, mod_2, mod_3,mod_4). Each of the ‘mod’ objects in this list must provide the following items:

ParamID

(character)
The ID of the parameter to be modified.

newvalue

(numeric)
Numeric value to be written into the text file.

filename

(character)
Name of the text file that will be modified.

row

(numeric)
Row number in filename where newvalue will be written.

col.ini

(numeric)
Starting column number in filename where newvalue is going to be written.

col.fin

(numeric)
Ending column number in filename where newvalue is going to be written.

decimals

(numeric)
Number of decimal places used to write newvalue into filename.

Value

No return value

Author(s)

Rodrigo Marinao Rivas ra.marinao.rivas@gmail.com, Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com

See Also

hydromod


hydroMOPSO documentation built on June 18, 2025, 9:15 a.m.