WriteObs | R Documentation |
Export forcing data and discharge observation files from R.
WriteObs(
x,
filename,
dt.format = "%Y-%m-%d",
round = NULL,
signif = NULL,
obsid = NULL,
append = FALSE
)
WritePTQobs(
x,
filename,
dt.format = "%Y-%m-%d",
round = NULL,
signif = NULL,
obsid = NULL,
append = FALSE
)
x |
The object to be written, a |
filename |
Path to and file name of the file to import. Windows users: Note that Paths are separated by '/', not '\'. |
dt.format |
Date-time |
round , signif |
Integer, number of decimal places and number of significant digits to export, respectively. See |
obsid |
Integer vector containing observation IDs/SUBIDs in same order as columns in |
append |
Logical, if |
WriteObs
is a convenience wrapper function of fwrite
to export a HYPE-compliant observation file.
Headers are generated from attribute obsid
on export (see attr
on how to create and access it).
Observation IDs are SUBIDs or IDs connected to SUBIDs with a ForcKey.txt file.
If the first column in x
contains dates of class POSIXt
, then they will be formatted according to dt.format
before writing the output file.
If round
is specified, then WriteObs()
will use round
to round the observation values to a specified number of decimal places.
Alternatively, signif
can be used to round the observation values to a specified number of significant digits using signif
.
Finally, if both round
and signif
are specified, then the observation values will be first rounded to the number of decimal places specified
with round
and then rounded to the number of significant digits specified with signif
.
No return value, called for export to text files.
ReadObs
WriteXobs
te <- ReadObs(filename = system.file("demo_model", "Tobs.txt", package = "HYPEtools"))
WriteObs(x = te, filename = tempfile())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.