View source: R/GaussianSmooth.R
| GaussianSmooth | R Documentation |
This is a utility function designed to calculate rolling Gaussian smooth (kernel smoothing). The function will try and fill in missing time gaps to get a full time sequence but return a data frame with the same number of rows supplied.
GaussianSmooth(
mydata,
pollutant = "o3",
sigma = 24L,
type = "default",
data.thresh = 0,
new.name = NULL,
date.pad = FALSE,
...
)
mydata |
A data frame containing a |
pollutant |
The name of a pollutant, e.g., |
sigma |
The value of |
type |
Used for splitting the data further. Passed to |
data.thresh |
The % data capture threshold. No values are calculated if data capture over the period of interest is less than this value. |
new.name |
The name given to the new column(s). If not supplied it will create a name based on the name of the pollutant and the averaging period used. |
date.pad |
Should missing dates be padded? Default is |
... |
Passed to |
The function provides centre-aligned smoothing out to 3 sigma, which captures 99.7% of the data.
A tibble with two new columns for the Gaussian smooth value.
David Carslaw
# Gaussian smoother with sigma = 24
mydata <- GaussianSmooth(mydata,
pollutant = "o3", sigma = 24, data.thresh = 75)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.