Skip to content

insert element in IBrokers/XTS time series?

3 messages · Michael, Sean Carmody

#
still not working...
On Sat, Jul 4, 2009 at 2:10 PM, Sean Carmody<seancarmody at gmail.com> wrote:
#
It works for me (albeit with the warning about column names I
mentioned)! What do you get from

class(time(myhist))?

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

  
    
#
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: