From adf2ea1c571b12be4a3e6d2410528831dcac50c3 Mon Sep 17 00:00:00 2001 From: Eric Hung Date: Wed, 3 Aug 2016 15:00:44 +0800 Subject: [PATCH] Translate xsubset into length of the series To coordinate with addPoints(), when x is specified by numeric vector and without subsetting the intersection of x and the index of series will be FALSE because xsubset is always "". It should be the index of the raw series, namely, 1:NROW(x), which is also the original setting in chartSeries. --- R/chartSeries.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/chartSeries.R b/R/chartSeries.R index 6ab6ecd3..de3dc423 100644 --- a/R/chartSeries.R +++ b/R/chartSeries.R @@ -402,7 +402,7 @@ function(x, sub.index <- index(do.call(subsetvec[1],list(x,subset.n))) xsubset <- which(index(x) %in% sub.index) } else xsubset <- which(index(x) %in% index(x[subset])) - } else xsubset <- "" + } else xsubset <- 1:NROW(x) xdata <- x x <- x[xsubset]