Writes the rvt file for a given time series dataset. The type of rvt file to write is
determined by the rvt_type argument, which must match one of the supported Raven types.
Note that this function does not support the writing of meteorological data, this is handled
by the rvn_rvt_write_met
function.
The format of the rvt file, including required fields to write to file, are determined from
the supplied rvt_type parameter and from the mapping provided by data("rvn_rvt_mappings_data")
. The
data_type is also checked against the provided mappings to check for valid state variables and
accompanying units.
If the data is found to have an inconsistent timestep, the function will attempt to correct it
by infilling missing time steps with rvn_ts_infill
. If successful, a warning is issued
to the user and the function will proceed, else an error will be raised.
The timezone of the xts object is used as supplied to write to file, no assumption on changing the
time zone is done in this function.
No other quality control of the data is performed here. Some rvt types, such as ObservationWeights,
cannot have missing values in the data; it is the responsibility of the user to supply x
with
no missing values if required. Any missing values in x
are written to file with the
missing value code provided by NA_value
.
x
should be an xts time series object with multiple rows of data and a single column.