ReadInfo {HYPEtools} | R Documentation |
Read an 'info.txt' file
Description
Import a HYPE model settings information file as list into R.
Usage
ReadInfo(
filename = "info.txt",
encoding = c("unknown", "UTF-8", "latin1"),
mode = c("simple", "exact"),
comment.duplicates = TRUE
)
Arguments
filename |
Path to and file name of the info.txt file to import. |
encoding |
Character string, encoding of non-ascii characters in imported text file. Particularly relevant when
importing files created under Windows (default encoding "Latin-1") in Linux (default encoding "UTF-8") and vice versa. See
also argument description in |
mode |
Use |
comment.duplicates |
Logical, if |
Details
Using ReadInfo
with the simple
mode discards all comments of the imported file (comment rows and in-line comments). The function's purpose is to quickly
provide access to settings and details of a model run, not to mirror the exact info.txt file structure into an R data object. If you would like to mirror the exact file
structure, then use the exact
mode.
Value
ReadInfo
returns a named list. List names are settings codes
(see info.txt documentation). Settings with two
codes are placed in nested lists, e.g. myinfo$basinoutput$variable
. Multi-line subbasin definitions for basin outputs and class
outputs are merged to single vectors on import.
See Also
WriteInfo
AddInfoLine
RemoveInfoLine
Examples
te <- ReadInfo(filename = system.file("demo_model",
"info.txt", package = "HYPEtools"))
te