projects
/
talweg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'update'
[talweg.git]
/
pkg
/
R
/
F_Neighbors.R
diff --git
a/pkg/R/F_Neighbors.R
b/pkg/R/F_Neighbors.R
index
238274b
..
202b7e2
100644
(file)
--- a/
pkg/R/F_Neighbors.R
+++ b/
pkg/R/F_Neighbors.R
@@
-13,6
+13,10
@@
NeighborsForecaster = R6::R6Class("NeighborsForecaster",
# (re)initialize computed parameters
private$.params <- list("weights"=NA, "indices"=NA, "window"=NA)
# (re)initialize computed parameters
private$.params <- list("weights"=NA, "indices"=NA, "window"=NA)
+ # Do not forecast on days with NAs (TODO: softer condition...)
+ if (any(is.na(data$getCenteredSerie(today))))
+ return (NA)
+
# Determine indices of no-NAs days followed by no-NAs tomorrows
fdays = getNoNA2(data, max(today-memory,1), today-1)
# Determine indices of no-NAs days followed by no-NAs tomorrows
fdays = getNoNA2(data, max(today-memory,1), today-1)