deleteSpikes | R Documentation |
Finds spikes, and sets their values to be NA_real_.
deleteSpikes(
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 datetime. |
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 |
One of hi (high spikes), low (low spikes) or both (the default). |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful, returns a data frame consiting of the datetime and the original obs values, where
all of the spike values have been set to be NA_real_
. If no spikes are found a message is
printed and the fucntion returns the value FALSE
.
Kevin Shook Alex Cebulski
findSpikes
BadLake <- BadLake7376
# finds all windspeeds which change by more than 10 m/s per interval,
# and sets their values to NA_real_
BadLake$u.nospikes <- deleteSpikes(BadLake7376, 3, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.