findSpikes | R Documentation |
Finds spikes (short bursts of very large or small values) in the specified time variable. This uses the R base function diff to calculate the difference between the next (lead) and current value.
findSpikes(
obs,
colnum = 1,
threshold = 0,
spike_direction = "both",
logfile = ""
)
obs |
Required. A CRHMr obs data frame. |
colnum |
Optional. The number of the column to test for spikes, not
including the |
threshold |
Required. The threshold for the change in the
observed values. The threshold is actually a rate, i.e. the change per unit
time. So if you are looking at air temperature, and the threshold is set to
|
spike_direction |
string 'both' OR 'hi' OR 'low' to look at both high and low or hi or low spikes. |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful and there are no spikes, returns 0
. If there are
spikes, returns their datetime
values. If unsuccessful returns
FALSE
.
If quiet=FALSE
, the function displays a list of the datetimes of
the spikes.
Kevin Shook, Alex Cebulski
deleteSpikes
findGaps
findDupes
# check for spikes in wind speed - look for changes greater than 10 m/s per interval
findSpikes(BadLake7376, 3, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.