I have two points (5,0.45) & (6,0.50) and need to find the value when x=5.019802 by linear interpolation
But how to code it in R?
I tried the code below but just got a graph.
x <- c(5,6)
y <- c(0.45,0.50)
interp <- approx(x,y)
plot(x,y,pch=16,cex=2)
points(interp,col='red')