Description Usage Arguments Value Examples
Demonstrates a distortion of the overall trend as a consequence of the leveraging effect of opening and closing of monitoring sites with different magnitudes over the period examined using rolling trend plots.
1 2 3 | rolling_trends(obs, pollutant, window.width = c(2, 3, 5, 7, 10, 12, 15),
avg.ts = "year", stat = "median", start.date = "2000-01-01",
end.date = "2017-12-31", parallel = FALSE, verbose = FALSE)
|
obs |
A data frame of ambient pollutant concentration data. Must contain the columns: site_code, date,
value. If 'pollutant' is a pollutant ratio, the data frames of the corresponding pollutants
must be supplied as a list of data frames in the order they are given in the ratio. E.g. for
|
pollutant |
The pollutant of interest (character string). To calculate rolling change trend for a pollutant ratio,
separate the two pollutants with a forward slash e.g. |
window.width |
The width of the moving window, n, over which the change in concentration is calculated (in years). This can be a vector (to compare rolling and average trends over a range of window widths) or a numeric (to return the rolling trend for a single window width). |
avg.ts |
The resolution to which to average each time series, upon which the rolling regression is carried out.
For example, setting |
stat |
The metric (character string) used to average the ambient concentration data by year. Options: "median", "mean". |
start.date, end.date |
The starting and ending dates (character string) of the period of interest over which to calculate and plot the change trend. |
parallel |
Logical indicating whether the rolling changes should be computed in parallel. If |
A plot (or, if window.width
is a vector, a list of plots labelled by the value of the window width) of the
rolling trends (left) and the average trend across the same data as was used in the rolling trends (i.e. filtered by the
window.width
) (right).
1 2 3 4 5 6 7 | ## Not run:
rolling_trends(london_nox_data, pollutant = "nox",
window.width = c(2, 5, 7, 10), stat = "median",
start.date = "2000-01-01", end.date = "2017-12-31",
parallel = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.