Introduction

er.helpers is an R package that facilitates the analysis and reporting of environmental indicators.

We can group these helper functions into anomaly calculation, data aggregation, data acquisition, likelihood category estimation, precipitation indices, RShiny development, seasonality calculations, data summarisation and visualisation, and trend calculation.

  • Anomaly calculation: Functions to easily calculate anomalies of environmental indicators (e.g. temperature, rainfall, etc.
  • Data aggregation: Environmental statistics are often aggregated using missing data criteria agreed by international organisations. This package includes functions to aggregate (mean, sum, max, min, etc.) environmental data specifying a maximum number (or proportion) of missing data and a maximum number of consecutive missing data.
  • Data acquisition: Environmental data is often stored in cloud services like AWS S3. This package has wrapper functions to the aws.s3 R package to facilitate dataset retrieval and discovery.
  • Likelihood estimation: Environmental reporting often involves communicating the likelihood of an event. This package contains functions to categorise the likelihood of a statistic based on its p-value. The categories are based on the IPCC categories and simplified versions used by Statistics NZ.
  • Precipitation: Functions to calculate some standard precipitation indices (precipitation from very wet days).
  • R Shiny: Functions to facilitate the development of R Shiny applications.
  • Seasonality: A function to obtain the season of a date.
  • Summary and visualisation: A function to extract a range and format it to be used in plot labels. Functions to automatically order common environmental factors like seasons, likelihoods, and statistics. Functions to round percentages while maintaining their sum.
  • Trends: Functions to calculate environmental trends (Sen’s slope, Mann-Kendall test, and linear models).
  • Palettes: Colour palettes to be used for points, snz webpages or ea19 report images.
  • Sankey: A function to build datasets for sankey diagrams.
  • Grids: A function to make grids from meshblock data, and standard hexagonal grids for use.

Installation

# install.packages("remotes")
remotes::install_github("StatisticsNZ/er.helpers", build_vignettes = TRUE)

Documentation

Webpage URL:

https://statisticsnz.github.io/er.helpers/


Copyright and Licensing

The package is Crown copyright (c) 2020, Statistics New Zealand on behalf of the New Zealand Government, and is licensed under the MIT License.


Creative Commons License
This document is Crown copyright (c) 2020, Statistics New Zealand on behalf of the New Zealand Government, and is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.