I'd like to know how I can get the points that are generated by my curve. I'm having trouble getting the results of my last code statement.
In addition, I got the maximum and minimum points of the curve, but I would also like to get the first and last point of the curve. Can you get the first and last point on my curve?
I tried to use some concepts like head or summary, but they did not work for my last statement. My code is as follows:
plot(dados.frame)
dados.loess <- loess(duracao ~date_time, data=dados.frame)
xl <- with(dados.frame, seq(min(date_time),max(date_time), (max(date_time) - min(date_time))/1000))
y.predict <- predict(dados.loess, xl)
lines(xl,y.predict)
infl <- c(FALSE, diff(diff(y.predict)>0)!=0)
points(xl[infl ], y.predict[infl ], col="Red", pch=19, cex=1.25)