X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FJ_Neighbors.R;fp=pkg%2FR%2FJ_Neighbors.R;h=ceea8037267ee610ef3f09f1ef75bf75b8a8223e;hp=2caedc58954a16721fd107e1b69647e37a272930;hb=8ab6420267542d34b7428f978aa76ba939b9754b;hpb=aa5397f16be60b338e303b26cfceb65defac3054 diff --git a/pkg/R/J_Neighbors.R b/pkg/R/J_Neighbors.R index 2caedc5..ceea803 100644 --- a/pkg/R/J_Neighbors.R +++ b/pkg/R/J_Neighbors.R @@ -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]