View source: R/weighingGauge2.R
weighingGauge2 | R Documentation |
Removes positive and negative spikes from deaccumulated weighing gauge precipitation. The gaps left from spike removal are infilled by linear interpolation. This function is a wrapper for other functions and was suggested by Craig Smith. This function need not be called if your data does not contain any spikes. It is a good idea to use weighingGaugePlot
to look at your data before calling this function. Note that this function will also remove gauge resets, if they are wihin the range of the spikeThreshold
.
weighingGauge2(
obs,
precipCol = 1,
spikeThreshold = 1000,
maxSpikeGap = 3,
quiet = TRUE,
logfile = ""
)
obs |
Required. A standard CRHMr obs file. |
precipCol |
Optional. The number of the column containing the weighting gauge cumulative precipitation data, not including the |
spikeThreshold |
Optional. Threshold for single-interval precipitation (mm). Any spikes (changes in cumulative precipitation) whose absoloute value is greater than the threshold will be deleted. The default value is 1000 mm. |
maxSpikeGap |
Optional. Maximum length of spikes (in time steps) to be filled. Default is 3. |
quiet |
Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If unsuccessful, returns FALSE
. If sucessful, returns a modified version of the obs
dataframe containing only the datetime and the adjusted precipitation values.
If you don't specify a large enough value for maxSpikeGap
, then all of the values after the spike will be set to NA
.
Kevin Shook
weighingGauge1
weighingGauge3
weighingGauge4
weighingGaugePlot
weighingGaugeInterval
## Not run:
test2 <- weightingGauge2(wg, spikeThreshold = 300)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.