Calculating the Derivatives
calcDerivatives(data, column, groupby, time = NA, order = 2, window = 5)a data frame contains derivatives.
a data frame.
names of variables in the long format that correspond to multiple variables in the wide format.
Character vector. Only used if the data is in a data.frame.
A variable name in the data frame containing sampling time information.
integer scalar.
integer scalar.Must be an odd number
examples
#eg1.
derivatives1 <- calcDerivatives(data=example3,column='expected',groupby='year',order=2,window=5,interval=1)
#eg2.
derivatives2 <- calcDerivatives(data=example3,column=c('expected','current'),groupby='year',time='myTime',order=2,window=5,interval=1)
#eg3.
derivativese3 <- calcDerivatives(data=example3,column=c('expected','current'),groupby='year',order=2,window=5,interval=1)