View source: R/functioncollection_import.R
ReadInfo | R Documentation |
Import a HYPE model settings information file as list into R.
ReadInfo(
filename = "info.txt",
encoding = c("unknown", "UTF-8", "latin1"),
mode = c("simple", "exact"),
comment.duplicates = TRUE
)
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 |
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.
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.
WriteInfo
AddInfoLine
RemoveInfoLine
te <- ReadInfo(filename = system.file("demo_model",
"info.txt", package = "HYPEtools"))
te
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.