View source: R/preproc_precondition_data.R
preproc_precondition_data | R Documentation |
Pre-conditions data with time information and n-day moving averages, with options
to fill missing days with NA
values.
preproc_precondition_data(
data = NULL,
Date,
value,
date_format = "%Y-%m-%d",
fill_daily = TRUE
)
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 |
These columns are added to the data:
year
month
day
decimal_date
WY
Water Year: October 1 to September 30
CY
Climate Year: April 1 to March 30
Q3
3-Day Moving Average: computed at end of moving interval
Q7
7-Day Moving Average: computed at end of moving interval
Q30
30-Day Moving Average: computed at end of moving interval
jd
Julian 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.
A data.frame with Date, value, and additional columns with time and n-day moving average information.
preproc_fill_daily
, rollmean
preproc_precondition_data(data = example_obs, Date = "Date", value = "streamflow_cfs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.