Skip to content
Prev 4484 / 15274 Next

insert element in IBrokers/XTS time series?

Here's a more elegant approach that should not generate the error message:

xts(rbind(coredata(myhist), rep(NA,dim(myhist)[2])),
order.by=c(index(myhist), as.Date("2009-01-01")))

Note that if class(index(myhist)) is not type "Date" you will need to
replace as.Date with the appropriate constructor, e.g. as.POSIXct or
as.chron.

Regards,
Sean.
On Mon, Jul 6, 2009 at 3:09 PM, Michael<comtech.usa at gmail.com> wrote: