removeSpikes: removeSpikes

Description Usage Arguments Details Value Author(s) Examples

Description

Identifies spikes and replaces them via interpolation

Usage

1
removeSpikes(v, sdLimit = 4, runLength = 99, loops = 4)

Arguments

v

The variable from which to remove spikes.

sdLimit

The multiple of the running standard deviation at which to remove spikes. Default is 4.

runLength

The number of measurements over which to calculate the running mean and standard deviation. The default is 99.

loops

The number of times to iterate the calculation.

Details

The function calculates a running mean and standard deviation, then flags points for which the deviation from the mean exceeds a specified multiplier times the running standard deviation. It then replaces those points by interpolation. It repeats this up to a specified number of times, in case the running values are changed by the removal-and-interpolation process.

Value

The input vector with identified spikes removed and replaced by interpolation.

Author(s)

William Cooper

Examples

1
2
RAFdata$DSPIKED <- removeSpikes(RAFdata$ATTACK)
RAFdata$DSPIKED <- removeSpikes(RAFdata$ATTACK, sdLimit=2, runLength=49, loops=10)

WilliamCooper/Ranadu documentation built on July 10, 2019, 12:40 a.m.