'update'
[talweg.git] / pkg / R / J_Neighbors.R
index 2caedc5..ceea803 100644 (file)
@@ -18,6 +18,9 @@ getNeighborsJumpPredict = function(data, today, memory, predict_from, horizon,
        indices = params$indices[filter]
        weights = params$weights[filter]
 
+       if (is.na(indices[1]))
+               return (NA)
+
        gaps = sapply(indices, function(i) {
                if (predict_from >= 2)
                        data$getSerie(i)[predict_from] - data$getSerie(i)[predict_from-1]