I am using a monthly time series data which is infact a xts object. My aim is to covert the monthly data to daily data, such that each day in a Month has a value of the particular month.
For example:
library("xts")
observation_dates <- as.Date(c("01.12.1993", "01.01.1994",
"01.02.1994", "01.03.1994", "01.04.1994", "01.05.1994",
"01.06.1994", "01.07.1994", "01.08.1994", "01.09.1994",
"01.10.1994", "01.11.1994", "01.12.1994"), format = "%d.%m.%Y")
air_data <- zoo(matrix(c(21, 21, 21, 30, 35.5, 36, 38.5,
33, 37, 37, 30, 24, 21), ncol = 1), observation_dates)
colnames(air_data) = "air_temperature"
The series is as shown above. I want to have all the 31 days in December 1993 to have a value of 21 (Air temp) so that average of the month still remains 21. And similarly i want to proceed for the rest of the months as shown.
I have tried using to.period(x, period="days")
but nothing changes.
please does anyone have any idea? Your help would be appreciated