Learn R Programming

Maeswrap (version 1.4.11)

readPAR: Reads the value of a parameter in a MAESTRA/MAESPA input file.

Description

Reads the value of any parameter in a namelist in one of the MAESTRA/MAESPA input files. Also works for other text files that have the FORTRAN namelist input structure. Optionally specifies in which namelist to look for the parameter.

Usage

readPAR(datfile, parname, namelist = NA, fail=TRUE)

Arguments

datfile
Name of the input file.
parname
Name of the parameter.
namelist
The namelist to look in, otherwise looks in the whole file.
fail
Logical. If TRUE, stops with an error when parameter is not found.

Value

  • Either one value, or a vector, depending on how many values are specified for the parameter in the input file.

See Also

replacePAR

Examples

Run this code
# Read the number of trees in the plot:
readPAR("confile.dat", "notrees", "plot")

# Read the X and Y coordinates:
readPAR("confile.dat", "xycoords", "xy")

Run the code above in your browser using DataLab