calcDerivatives function

Calculating the Derivatives

Calculating the Derivatives

calcDerivatives(data, column, groupby, time = NA, order = 2, window = 5)

Arguments

  • data: a data frame.
  • column: names of variables in the long format that correspond to multiple variables in the wide format.
  • groupby: Character vector. Only used if the data is in a data.frame.
  • time: A variable name in the data frame containing sampling time information.
  • order: integer scalar.
  • window: integer scalar.Must be an odd number

Returns

a data frame contains derivatives.

Details

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)
  • Maintainer: Yueqin Hu
  • License: GPL (>= 3)
  • Last published: 2024-10-18

Useful links