'update'
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 11 Apr 2017 14:17:50 +0000 (16:17 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 11 Apr 2017 14:17:50 +0000 (16:17 +0200)
pkg/R/F_Neighbors.R
pkg/R/plot.R
pkg/R/utils.R

index 9af4725..32d5cff 100644 (file)
@@ -216,21 +216,6 @@ NeighborsForecaster = R6::R6Class("NeighborsForecaster",
        )
 )
 
        )
 )
 
-#' getNoNA2
-#'
-#' Get indices in data of no-NA series followed by no-NA, within [first,last] range.
-#'
-#' @inheritParams dateIndexToInteger
-#' @param first First index (included)
-#' @param last Last index (included)
-#'
-.getNoNA2 = function(data, first, last)
-{
-       (first:last)[ sapply(first:last, function(i)
-               !any( is.na(data$getCenteredSerie(i)) | is.na(data$getCenteredSerie(i+1)) )
-       ) ]
-}
-
 #' getConstrainedNeighbs
 #'
 #' Get indices of neighbors of similar pollution level (among same season + day type).
 #' getConstrainedNeighbs
 #'
 #' Get indices of neighbors of similar pollution level (among same season + day type).
index 48b456c..fe2fb4e 100644 (file)
@@ -236,7 +236,7 @@ plotRelVar = function(data, fil)
 {
        ref_var = c( apply(data$getSeries(fil$neighb_indices),1,sd),
                apply(data$getSeries(fil$neighb_indices+1),1,sd) )
 {
        ref_var = c( apply(data$getSeries(fil$neighb_indices),1,sd),
                apply(data$getSeries(fil$neighb_indices+1),1,sd) )
-       fdays = getNoNA2(data, 1, fil$index-1)
+       fdays = .getNoNA2(data, 1, fil$index-1)
        global_var = c(
                apply(data$getSeries(fdays),1,sd),
                apply(data$getSeries(fdays+1),1,sd) )
        global_var = c(
                apply(data$getSeries(fdays),1,sd),
                apply(data$getSeries(fdays+1),1,sd) )
index ddf0bb1..3f32868 100644 (file)
@@ -115,3 +115,18 @@ getSimilarDaysIndices = function(index, data, limit, same_season, days_in=NULL)
                return (day %in% 1:4)
        return (day == day_ref)
 }
                return (day %in% 1:4)
        return (day == day_ref)
 }
+
+#' getNoNA2
+#'
+#' Get indices in data of no-NA series followed by no-NA, within [first,last] range.
+#'
+#' @inheritParams dateIndexToInteger
+#' @param first First index (included)
+#' @param last Last index (included)
+#'
+.getNoNA2 = function(data, first, last)
+{
+       (first:last)[ sapply(first:last, function(i)
+               !any( is.na(data$getCenteredSerie(i)) | is.na(data$getCenteredSerie(i+1)) )
+       ) ]
+}