Displaying 1 result from an estimated 1 matches for "final_week".
2012 Sep 27
1
How does "apply.monthly" function works (xts package)
...data bases with monthly data and 1 with weekly data, so I want to
convert my weekly to monthly data in order to have the same periodicity in
all of them.
I've read that package xts can help me with this issue, so I have done the
following script:
*ini_week<-as.Date("2010-09-19")
final_week<-seq(ini_week, length.out=104, by = "1 week")
vts<-read.csv("C:/DATA.csv",header = TRUE)
vts<-vts[,2]
wvts<-xts(vts, order.by=final_week)
mes<-apply.monthly(wvts,sum)
*A portion of the result is this one:
[,1]
2010-09-26 2.9
2010-10-31 8.5
2010-11...