almost finished debug
[talweg.git] / pkg / R / Data.R
index e33e480..35f8524 100644 (file)
@@ -30,7 +30,9 @@
 #' \item{\code{getExo(index)}}
 #'   {Get exogenous variables at specified index.}
 #' \item{\code{getExoHat(index)}}
-#'   {Get estimated exogenous variables at specified index.}}
+#'   {Get estimated exogenous variables at specified index.}
+#' \item{\code{getCoupleDays(first,last)}}
+#'   {Get indices of no-NA series followed by no-NA, within [first,last] range.}}
 Data = R6::R6Class("Data",
        private = list(
                .data = list()
@@ -83,5 +85,14 @@ Data = R6::R6Class("Data",
                ,
                removeLast = function()
                        private$.data <- private$.data[1:(length(private$.data)-1)]
+               ,
+               getCoupleDays = function(first, last)
+               {
+                       (first:last)[ sapply(first:last, function(i) {
+                               !any(
+                                       is.na(private$.data$getCenteredSerie(i)) |
+                                       is.na(private$.data$getCenteredSerie(i+1)) )
+                       }) ]
+               }
        )
 )