I searched for quite a while on this question, but can't find an answer. The challenge is finding a way to subset an xts file by date with the form:
dat <- xts(1:10, as.Date("2000-01-01")+1:10)
date.1 <-as.Date("2000-01-05")
dat.subset <-dat[date.1/]
This doesn't work, of course, and neither do variations, such as:
dat.subset <-dat["date.1/"]
How can I subset with the date.1 object to produce the equivalent of:
dat.subset <-dat['2000-01-05/']