data(Arkansas)
x <- Arkansas$year
y <- Arkansas$sqrt.mayflies
# For a more accurate estimate, increase grid.size
model <- bent.cable(x,y, grid.size=20)
plot(x,y)
x.grid <- seq(min(x), max(x), length=200)
lines(x.grid, predict(model, x.grid), col='red')
Run the code above in your browser using DataLab