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)]