I would calculate the first derivative (dpH/dtime) of time series using two variables, time
and pH
.
Are there any kind of functions to do this in R or should I compute an extra function to do this?
Assuming pH
and time
are plain vectors try this:
library(pspline)
predict(sm.spline(time, pH), time, 1)