I am interested in a general root finding problem for an interpolation function.
Suppose I have the following (x, y) data:
(x, y)
set.seed(0) x &
Given data points and spline function as above, simply apply findzeros() from the pracma package.
findzeros()
library(pracma) xs <- findzeros(function(x) f3(x) - 2.85,min(x), max(x)) xs # [1] 3.924513 6.435812 9.207169 9.886618 points(xs, f3(xs))