Returns the ith difference of a time series of rth lag.
diff_cpp(x, lag, differences)
A vector
containing the differenced time series.
A vec
that is the time series
A unsigned int
that indicates the lag
A dif
that indicates how many differences should be taken
James J Balamuta