Thank David,

That is completely correct! I have no ideia how come matlab and Octave do
not do this... maybe the interp1 function has some kind of trick. .. maybe
the algorythm looks for the closest ranked values and not by its true value.
What ever...

Just sort it out in a not prety-but efficient way :-)

x=c(0.0265,-0.0003,0.0142,0.0263,0.0634,0.1145,0.2504)
y=c(58,107,152,239,362,512,724)
x1=0.0393216
kk=y[x==min(x)]
approxExtrap(x[y>kk],y[y>kk],x1, method="linear")
approx(x[y>kk],y[y>kk],x1)
plot(x, y, typ="o")
abline(v=x1, col=8)

Cool :-)

All the best,
Marta

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to