X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FData.R;h=35f8524c08c3306934122f69b8db9abab8d707b4;hp=e33e4809022e7875e53f88649b8431799826acb1;hb=af3b84f4cacade7d83221ca0249b546c50ddf340;hpb=5d83d8150dc135347d5ef39e5015b88f33fa9ee3 diff --git a/pkg/R/Data.R b/pkg/R/Data.R index e33e480..35f8524 100644 --- a/pkg/R/Data.R +++ b/pkg/R/Data.R @@ -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)) ) + }) ] + } ) )