preproc_fill_daily {HyMETT} | R Documentation |
Fills daily data with missing dates as NA
values
Description
Fills daily data with missing dates as NA
values. Days that are
absent from the daily time series are inserted with a corresponding value of NA
.
Usage
preproc_fill_daily(
data = NULL,
Date,
value,
POR_start = NA,
POR_end = NA,
date_format = "%Y-%m-%d"
)
Arguments
data |
'data.frame'. Optional data.frame input, with columns containing |
Date |
'Date' or 'character' vector when |
value |
'numeric' vector when |
POR_start |
'character' value. Optional period of record start. If not specified, defaults
to |
POR_end |
'character' value. Optional period of record end. If not specified, defaults to
|
date_format |
'character' string. Format of Date. Default is |
Details
Can be used prior to preproc_precondition_data
to fill daily data before computation
of n-day moving averages, or prior to preproc_audit_data
.
Value
A data.frame with Date
and value
, sequenced from POR_start
to POR_end
by 1 day.
See Also
preproc_audit_data
, preproc_precondition_data
Examples
Dates = c(seq.Date(as.Date("2020-01-01"), as.Date("2020-01-10"), by = "1 day"),
seq.Date(as.Date("2020-01-20"), as.Date("2020-01-31"), by = "1 day"))
values = c(seq.int(1, 22, 1))
preproc_fill_daily(Date = Dates, value = values)