r - Remove time from XTS -


i trying compare different timeseries, day.

currently typical xts object looks like:

> vwap.crs                     quantity quantity.1 2014-03-03 13:00:00 3423.500     200000 2014-03-04 17:00:00 3459.941    4010106 2014-03-05 16:00:00 3510.794    1971234 2014-03-06 17:00:00 3510.582     185822 

now, can strip time out of index follows:

> round(index(vwap.crs),"day") [1] "2014-03-04" "2014-03-05" "2014-03-06" "2014-03-07" 

my question is, how replace existing index in variable vwap.crs, rounded output above?

edit: to.daily fixed it

this should it

indexclass(vwap.crs) <- "date" 

also, take @ code in xts:::.drop.time


you way you're trying if use index<-

index(vwap.crs) <- round(index(vwap.crs),"day") 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -