Closed ethanbsmith closed 1 month ago
tbh, im not sure if we even need to check for mlti.panel. is there any harm in just doing this recycling for all scenarios?
Thanks for the PR! I just added a commit that removed some later checks on the length of 'col', 'lty', and 'lwd' so they're only in one place in plot.xts()
and one place in chart.lines()
. Can you test this to make sure that didn't break anything? Thanks!
hmm, im getting an error in addEventLines
now. need to drill into this to isolate the issues
Can you give me an example so I can take a look too?
x <- as.xts(sample_matrix)
plot(x, multi.panel = TRUE)
addEventLines(xts("a", index(x)[10]), pos = 2:3)
seems to only be drawing on pos = 4
there seems to be a very similar variant of parameter recycling going on at the beginning of this function., but using times
, not length,out
That's a bug, but not related to these changes. It's in the prior version on CRAN (0.14.0).
EDIT:
Actually, it's a bug in the example in the documentation. There's no 'pos' argument to addEventLines()
. You can do what you want with the 'on' argument.
library(xts)
data(sample_matrix)
sample.xts <- as.xts(sample_matrix)
events <- xts(letters[1:3],
as.Date(c("2007-01-12", "2007-04-22", "2007-06-13")))
plot(sample.xts[,4])
addEventLines(events, srt = 90, pos = 2)
sry, should be addEventLines(xts("a", index(x)[10]), on = 2:3)
thats the error im seeing
working fine. all issues were on my end
moved input length checks up in flow to cover both (multi.panel == TRUE) and (is.numeric(multi.panel)) fixes #423