Skip to content
Prev 317993 / 398502 Next

To convert a quarterly data to a monthly data.

On 20-02-2013, at 21:21, "Yuan, Rebecca" <rebecca.yuan at bankofamerica.com> wrote:

            
Here is an example using package zoo:

library(zoo)
yq <- zooreg(c(100,101,120,103), start=2000, frequency=4)

# complicated method
zm <- zooreg(rep(NA,12),start=2000,freq=12)
merge(yq,zm)
na.spline(merge(yq, zm)[, 1])

# Easy direct method taken from help pages of zoo

na.spline(yq, xout=as.yearmon(start(yq)+(0:11)/12)) 

or 

na.approx(yq, xout=as.yearmon(start(yq)+(0:11)/12))  


Berend