Skip to content
Prev 176866 / 398506 Next

First Derivative of Data Matrix

delta(index) is identically 1, so taking first differences is all that  
is needed. If the dtatframe's name is df then:

df$dacflong_dx <- c(NA, diff(acflong))     # the slash would not be a  
legal character in a variable name unless you jumped through some  
hoops that appear entirely without value

If you want to get rid of the first line of df then

df[-1]