Commit 05752b50 authored by unknown's avatar unknown
Browse files

v0.1.8.4 bug fixed in dyplot.default when NA period starts (ends) from the...

v0.1.8.4 bug fixed in dyplot.default when NA period starts (ends) from the first (last) date of the time serie
parent 950900cd
Package: airGRteaching
Type: Package
Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface)
Version: 0.1.8.3
Version: 0.1.8.4
Date: 2017-10-31
Authors@R: c(person("Olivier", "Delaigue", role = c("aut", "cre"), email = "airGR@irstea.fr"), person("Laurent", "Coron", role = c("aut")), person("Pierre", "Brigode", role = c("aut")), person("Guillaume", "Thirel", role = c("ctb")))
Depends: airGR (>= 1.0.9.43)
......
......@@ -99,9 +99,11 @@ dyplot.default <- function(x, Qsup = NULL, Qsup.name = "Qsup",
}
if (plot.na) {
naQ_rle <- rle(is.na(data$Qobs))
naQ_ide <- cumsum(naQ_rle$lengths)[naQ_rle$values] +1
naQ_ids <- naQ_ide - naQ_rle$lengths[naQ_rle$values] -1
naQ_ide <- cumsum(naQ_rle$lengths)[naQ_rle$values] + 1
naQ_ids <- naQ_ide - naQ_rle$lengths[naQ_rle$values] - 1
IDna <- data.frame(start = naQ_ids, end = naQ_ide)
IDna$start <- ifelse(IDna$start < 1 , 1 , IDna$start)
IDna$end <- ifelse(IDna$end > nrow(data), nrow(data), IDna$end )
for (i in seq_len(nrow(IDna))) {
dg <- dygraphs::dyShading(dygraph = dg,
from = as.character(data$DatesR)[IDna[i, "start"]],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment