rvn_rvt_write {RavenR} | R Documentation |
rvn_rvt_write generates a Raven rvt file from a time series
rvn_rvt_write( ts, params, units, dates = NULL, prd = NULL, tt = "00:00:00", dt = 1, ff = "raven_rvt_write.rvt" )
ts |
time series to write in xts or dataframe format |
params |
the full string expression for the parameters line to write to file |
units |
the full string expression for the units line to write to file |
dates |
vector of date objects passed, necessary only if ts is not xts |
prd |
period to use in writing rvt file, format "YYYY-MM-DD/YYYY-MM-DD" |
tt |
initial start time to file |
dt |
time interval to write to file |
ff |
filename to write to without .rvt extension (added automatically) |
This function writes the rvt file for a given time series dataset. The function will write out the entirety of the columns provided in the given xts object. Please ensure that the parameters supplied in the params and units objects match the xts object supplied.
flag |
returns TRUE if the function executed successfully |
rvn_rvt_wsc
to create an rvt file from Water Survey Canada (WSC) data
# load sample flow data system.file('extdata','run1_Hydrographs.csv', package = "RavenR") %>% rvn_hyd_read() -> mydata # write time series to rvt file using data from subbasin 36 rvn_rvt_write(mydata$hyd$Sub36, params = "HYDROGRAPH", units = "m3/s", ff = file.path(tempdir(), 'raven_rvt_write'))