OpCl works on xts objects but not on quantmod.OHLC objects. Is this a bug?

Example error:

x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1
set.seed(1)
x <- zoo(matrix(runif(20, 0, 1), nrow=5, ncol=4), x.Date)
q <- as.quantmod.OHLC(x,c("Open","High","Low","Close"))

# error
OpCl(q)
#> Error in `colnames<-`(`*tmp*`, value = "OpCl.q") : 
#>  attempt to set 'colnames' on an object with less than two dimensions

# OK
OpCl(as.xts(q))

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to