| preproc_precondition_data {HyMETT} | R Documentation |
Pre-conditions data with time information and n-day moving averages
Description
Pre-conditions data with time information and n-day moving averages, with options
to fill missing days with NA values.
Usage
preproc_precondition_data(
data = NULL,
Date,
value,
date_format = "%Y-%m-%d",
fill_daily = TRUE
)
Arguments
data |
'data.frame'. Optional data.frame input, with columns containing |
Date |
'Date' or 'character' vector when |
value |
'numeric' vector when |
date_format |
'character' string. Format of |
fill_daily |
'logical' value. Should gaps in |
Details
These columns are added to the data:
yearmonthdaydecimal_dateWYWater Year: October 1 to September 30
CYClimate Year: April 1 to March 30
Q33-Day Moving Average: computed at end of moving interval
Q77-Day Moving Average: computed at end of moving interval
Q3030-Day Moving Average: computed at end of moving interval
jdJulian date
This function also checks the time step of the data to make sure that it is daily time step. Daily
values with gaps are important to fill with NA to ensure proper calculation of n-day moving
averages. Use fill_daily = TRUE or preproc_fill_daily. Other time steps are currently not
supported and will return the data.frame without moving averages computed.
Value
A data.frame with Date, value, and additional columns with time and n-day moving average information.
See Also
Examples
preproc_precondition_data(data = example_obs, Date = "Date", value = "streamflow_cfs")