if (inherits(index, "Date") || is.character(index))
{
- tryCatch(indexAsDate <- as.Date(index), error=function(e) stop("Unrecognized index format"))
+ tryCatch(indexAsDate <- as.Date(index),
+ error=function(e) stop("Unrecognized index format"))
#TODO: tz arg to difftime ?
integerIndex <- round( as.numeric(
difftime(indexAsDate, as.Date(data$getTime(1)[1])) ) ) + 1