CentralDifference: Central Difference

Description Usage Arguments Value

Description

Given a numeric series x, compute its n-offset central difference y, such that y[i] = x[i+n] - x[i-n].

Usage

1
2
3
4
5
6
7
8
CentralDifference(x, ...)

## S3 method for class 'numeric'
CentralDifference(x, n = 1, order = 1, samplingRate = 2
  * n, ...)

## S3 method for class 'data.frame'
CentralDifference(x, n = 1, order = 1, ...)

Arguments

x

A numeric vector or a data frame of numeric vectors.

...

Placeholder for future methods.

n

An atomic numeric, the number of samples offset from the current sample used in the central difference. Default is 1.

order

An atomic numeric, the number of times the central-difference operator is applied to x. Default is 1.

samplingRate

An atomic numeric, the sampling rate of x, in hertz. The raw central difference of x is divided by the sampling rate so that the central difference can be interepreted as an estimate of the derivative of x. Default is 2*n, which yields the raw central difference.

Value

The central difference of x if x is numeric, or of each column of x if x is a data frame.


patrickreidy/ag501 documentation built on May 30, 2019, 10:01 p.m.