View source: R/weighingGauge3.R
weighingGauge3 | R Documentation |
Thes functions is a wrapper for the Savitzky-Golay polynomial filter function sgolayfilt
from the package signal. It passes the specified cumulative precipitation data, the filter length, the filter order (set to 1) and the derivative order (set to 0) to the filter. It is a good idea to use weighingGaugePlot
to look at your data before and after calling this function. Note that this function is only intended to be used with very high frequency (i.e. 1 minute) gauged data, and should not be used with longer-period accumulations.
weighingGauge3(
obs,
precipCol = 1,
filterLength = 0,
polynomial_order = 1,
quiet = TRUE,
logfile = ""
)
obs |
Required. A standard CRHMr obs file. |
precipCol |
Optional. The number of the column containing the weighing guage cumulative precipitation data, not including the |
filterLength |
Required. The number of time intervals used by the Savitzky-Golay polynomial filter. Note that this must be an ODD number. The appropriate value will depend on the type of your data, and the noise present. |
polynomial_order |
Optional. The order of the polynomial for the filter. Defaults to 1 by ECCC recommendation better smoothing is acheived with 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 the adjusted precipitation values. Note that the name of the precipitation variable is modified: '_sg_filtered'
is appended.
This function is potentially destructive, as it smooths the accumulated precipitation. You may need to set the filter length by trial-and error. You can check the effects using the function weighingGaugePlot
.
Kevin Shook
weighingGauge1
weighingGauge2
weighingGauge4
weighingGaugePlot
weighingGaugeInterval
## Not run:
test3 <- weighingGauge3(wg, filterLength=5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.