Learn R Programming

dsa (version 0.74.18)

fill31: Extending a daily time series to having 31 days each month.

Description

This function extends a time series to have 31 days.

Usage

fill31(x_ts, fill = "locf", to_ts = TRUE)

Arguments

x_ts

Time series that will be extended to 31 days each month.

fill

Method that is used to fill up time series. "locf": last observation carried forward, "lin": linear interpolation, "spline": spline interpolation.

to_ts

Boolean. Determines format of the output series. Either ts or xts.

Details

This function is used internally in dsa()

Examples

Run this code
# NOT RUN {
x<-xts::xts(rnorm(1095, 100,1), seq.Date(as.Date("2009-01-01"), length.out=1095, by="days"))
a31 <- fill31(x)
a <- drop31(a31, 1, 365)
# }

Run the code above in your browser using DataLab