'update'
[talweg.git] / pkg / R / plot.R
index b5a8e4b..d501d9e 100644 (file)
@@ -64,7 +64,8 @@ plotPredReal <- function(data, pred, index)
        measure = data$getSerie( pred$getIndexInData(index) )[1:length(pred$getForecast(1))]
 
        # Remove the common part, where prediction == measure
-       dot_mark <- ifelse(prediction[1]==measure[1], which.max(prediction==measure), 0)
+       dot_mark <- ifelse(prediction[1]==measure[1],
+               which.max(seq_along(prediction)[prediction==measure]), 0)
        prediction = prediction[(dot_mark+1):length(prediction)]
        measure = measure[(dot_mark+1):length(measure)]