My goal is to combine two time series (weekly in 1st column and monthly in 2nd column and the date format of the weekly time series).
I have a weekly time series with values from 2004-01-04 up to 2018-06-24.
I also have a monthly time series with values from 2004-01-01 up to 2018-06-01. (It always takes the first day of the month as -01)
For the monthly time series, I want to fill up the NA with the same value for every week in the same month.
I have tried the na.locf function in R:
na.locf(merge(monthly, foo=zoo(NA, order.by=seq(start(monthly), end(monthly), "week")))[, 1])
However, it does not quiet work out right.
In the end it should look something like this picture: