Package: rmweather 0.2.61

Stuart K. Grange

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

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) <doi:10.5194/acp-18-6223-2018> and Grange and Carslaw (2019) <doi:10.1016/j.scitotenv.2018.10.344>. 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) <doi:10.5194/acp-2020-1171>.

Authors:Stuart K. Grange [cre, aut]

rmweather_0.2.61.tar.gz
rmweather_0.2.61.zip(r-4.5)rmweather_0.2.61.zip(r-4.4)rmweather_0.2.61.zip(r-4.3)
rmweather_0.2.61.tgz(r-4.4-any)rmweather_0.2.61.tgz(r-4.3-any)
rmweather_0.2.61.tar.gz(r-4.5-noble)rmweather_0.2.61.tar.gz(r-4.4-noble)
rmweather_0.2.61.tgz(r-4.4-emscripten)rmweather_0.2.61.tgz(r-4.3-emscripten)
rmweather.pdf |rmweather.html
rmweather/json (API)

# Install 'rmweather' in R:
install.packages('rmweather', repos = c('https://skgrange.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/skgrange/rmweather/issues

Datasets:
  • data_london - Example observational data for the *rmweather* package.
  • data_london_normalised - Example of meteorologically normalised data for the *rmweather* package.
  • model_london - Example *ranger* random forest model for the *rmweather* package.

On CRAN:

6.37 score 49 stars 239 scripts 573 downloads 1 mentions 24 exports 50 dependencies

Last updated 6 months agofrom:55b3aba27d. Checks:OK: 5 NOTE: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 02 2024
R-4.5-winNOTENov 02 2024
R-4.5-linuxNOTENov 02 2024
R-4.4-winOKNov 02 2024
R-4.4-macOKNov 02 2024
R-4.3-winOKNov 02 2024
R-4.3-macOKNov 02 2024

Exports:%>%rmw_calculate_model_errorsrmw_cliprmw_do_allrmw_find_breakpointsrmw_model_importancermw_model_nested_setsrmw_model_statisticsrmw_nest_for_modellingrmw_normalisermw_normalise_nested_setsrmw_partial_dependenciesrmw_plot_importancermw_plot_normalisedrmw_plot_partial_dependenciesrmw_plot_test_predictionrmw_predictrmw_predict_nested_partial_dependenciesrmw_predict_nested_setsrmw_predict_nested_sets_by_yearrmw_predict_the_test_setrmw_prepare_datarmw_train_modelsystem_cpu_core_count

Dependencies:clicodetoolscolorspacecpp11dplyrfansifarverforeachgenericsggplot2gluegridExtragtableisobanditeratorslabelinglatticelifecyclelubridatemagrittrMASSMatrixmgcvmunsellnlmepdppillarpkgconfigpurrrR6rangerRColorBrewerRcppRcppEigenrlangsandwichscalesstringistringrstrucchangetibbletidyrtidyselecttimechangeutf8vctrsviridisviridisLitewithrzoo

Readme and manuals

Help Manual

Help pageTopics
Pseudo-function to re-export *magrittr*'s pipe.%>%
Pseudo-function to re-export functions from the *stats* package.base functions
Example observational data for the *rmweather* package.data_london
Example of meteorologically normalised data for the *rmweather* package.data_london_normalised
Pseudo-function to re-export *dplyr*'s common functions.dplyr functions
Example *ranger* random forest model for the *rmweather* package.model_london
Function to calculate observed-predicted error statistics.rmw_calculate_model_errors
Function to "clip" the edges of a normalised time series after being produced with 'rmw_normalise'.rmw_clip
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_do_all
Function to detect breakpoints in a data frame using a linear regression based approach.rmw_find_breakpoints
Function to train random forest models using a nested tibble.rmw_model_nested_sets
Functions to extract model statistics from a model calculated with 'rmw_calculate_model'.rmw_model_importance rmw_model_statistics
Function to nest observational data before modelling with *rmweather*.rmw_nest_for_modelling
Function to normalise a variable for "average" meteorological conditions.rmw_normalise
Function to normalise a variable for "average" meteorological conditions in a nested tibble.rmw_normalise_nested_sets
Function to calculate partial dependencies after training with *rmweather*.rmw_partial_dependencies
Function to plot random forest variable importances after training by 'rmw_train_model'.rmw_plot_importance
Function to plot the meteorologically normalised time series after 'rmw_normalise'.rmw_plot_normalised
Function to plot partial dependencies after calculation by 'rmw_partial_dependencies'.rmw_plot_partial_dependencies
Function to plot the test set and predicted set after 'rmw_predict_the_test_set'.rmw_plot_test_prediction
Function to predict using a *ranger* random forest.rmw_predict
Function to calculate partial dependencies from a random forest models using a nested tibble.rmw_predict_nested_partial_dependencies
Function to make predictions from a random forest models using a nested tibble.rmw_predict_nested_sets
Function to make predictions by meteorological year from a random forest models using a nested tibble.rmw_predict_nested_sets_by_year
Functions to use a model to predict the observations within a test set after 'rmw_calculate_model'.rmw_predict_the_test_set
Function to prepare a data frame for modelling with *rmweather*.rmw_prepare_data
Function to train a random forest model to predict (usually) pollutant concentrations using meteorological and time variables.rmw_train_model
Function to return the system's number of CPU cores.system_cpu_core_count
Function to get weekday number from a date where '1' is Monday and '7' is Sunday.wday_monday
Squash the global variable notes when building a package.zzz