How to find points by linear interpolation
linear-interpolation, r
Solution
You just need to specify an `xout` value.
approx(x,y,xout=5.019802)
$x
[1] 5.019802
$y
[1] 0.4509901
Problem
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') ```