| removeSpikes | R Documentation | 
Identifies spikes and replaces them via interpolation
removeSpikes(v, sdLimit = 4, runLength = 99, loops = 4)
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.  | 
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.
The input vector with identified spikes removed and replaced by interpolation.
William Cooper
RAFdata$DSPIKED <- removeSpikes(RAFdata$ATTACK) RAFdata$DSPIKED <- removeSpikes(RAFdata$ATTACK, sdLimit=2, runLength=49, loops=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.