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