As shown in the picture, row 19 contains a missing data. However, I am suppose to plot points by iterating over a sliding window of 5 using 2 previously defined functions.
I thought of simply omitting the row with the missing data, but this would leave me with 29 rows and as such I would face the issue of being short of one value.
As such, I thought of using creating a lm and using predict(). However, the usual predict predicts x values from y. I would like to predict x when y = 0.7. How would I go about doing this? I have the lm as:
akima.fit <- lm(data$akima_data[,2]~data$akima_data[,1])