Learn R Programming

rmweather (version 0.2.62)

Tools to Conduct Meteorological Normalisation and Counterfactual Modelling for Air Quality Data

Description

An integrated set of tools to allow data users to conduct meteorological normalisation and counterfactual modelling for air quality data. The meteorological normalisation technique uses predictive random forest models to remove variation of pollutant concentrations so trends and interventions can be explored in a robust way. For examples, see Grange et al. (2018) and Grange and Carslaw (2019) . The random forest models can also be used for counterfactual or business as usual (BAU) modelling by using the models to predict, from the model's perspective, the future. For an example, see Grange et al. (2021) .

Copy Link

Version

Install

install.packages('rmweather')

Monthly Downloads

271

Version

0.2.62

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Stuart K. Grange

Last Published

February 21st, 2025

Functions in rmweather (0.2.62)

rmw_plot_partial_dependencies

Function to plot partial dependencies after calculation by rmw_partial_dependencies.
rmw_normalise_nested_sets

Function to normalise a variable for "average" meteorological conditions in a nested tibble.
rmw_partial_dependencies

Function to calculate partial dependencies after training with rmweather.
rmw_plot_normalised

Function to plot the meteorologically normalised time series after rmw_normalise.
rmw_plot_importance

Function to plot random forest variable importances after training by rmw_train_model.
wday_monday

Function to get weekday number from a date where 1 is Monday and 7 is Sunday.
zzz

Squash the global variable notes when building a package.
rmw_train_model

Function to train a random forest model to predict (usually) pollutant concentrations using meteorological and time variables.
rmw_predict_nested_sets_by_year

Function to make predictions by meteorological year from a random forest models using a nested tibble.
rmw_predict_nested_sets

Function to make predictions from a random forest models using a nested tibble.
rmw_plot_test_prediction

Function to plot the test set and predicted set after rmw_predict_the_test_set.
system_cpu_core_count

Function to return the system's number of CPU cores.
rmw_predict

Function to predict using a ranger random forest.
rmw_predict_nested_partial_dependencies

Function to calculate partial dependencies from a random forest models using a nested tibble.
rmw_predict_the_test_set

Functions to use a model to predict the observations within a test set after rmw_calculate_model.
rmw_prepare_data

Function to prepare a data frame for modelling with rmweather.
model_london

Example ranger random forest model for the rmweather package.
rmw_do_all

Function to train a random forest model to predict (usually) pollutant concentrations using meteorological and time variables and then immediately normalise a variable for "average" meteorological conditions.
rmw_calculate_model_errors

Function to calculate observed-predicted error statistics.
base functions

Pseudo-function to re-export functions from the stats package.
rmw_find_breakpoints

Function to detect breakpoints in a data frame using a linear regression based approach.
%>%

Pseudo-function to re-export magrittr's pipe.
dplyr functions

Pseudo-function to re-export dplyr's common functions.
rmw_clip

Function to "clip" the edges of a normalised time series after being produced with rmw_normalise.
rmw_model_nested_sets

Function to train random forest models using a nested tibble.
rmw_nest_for_modelling

Function to nest observational data before modelling with rmweather.
rmw_normalise

Function to normalise a variable for "average" meteorological conditions.
data_london_normalised

Example of meteorologically normalised data for the rmweather package.
data_london

Example observational data for the rmweather package.
rmw_model_statistics

Functions to extract model statistics from a model calculated with rmw_calculate_model.