Skip to content

openair

3.1.0Package record

Tools for the Analysis of Air Pollution Data

8packages dependsuggested by 4
67.5Kdownloads / year
62.0%test coverage
12/13flavors OK

Overview

About

Tools to analyse, interpret and understand air pollution data. Data are typically regular time series and air quality measurement, meteorological data and dispersion model output can be analysed. The package is described in Carslaw and Ropkins (2012, doi:10.1016/j.envsoft.2011.09.008) and subsequent papers.

Changes in 3.1.0

Dependency Changes

  • {openair} now suggests {rnaturalearth} over {rnaturalearthdata}. {rnaturalearthdata} is still required for a medium map resolution and {rnaturalearthhires} for a high map resolution, but these are now managed by {rnaturalearth} directly.

Breaking Changes

  • strip.position, x.relation, and y.relation are now no longer function-level arguments and are handled via ....
  • The labels argument (as paired with breaks) is deprecated. If passed through ... it will be automatically mapped to its new place in the breakOpts() function.

New Features

  • Refinements to how parameters are passed via ... to plotting functions:
  • Graphical parameters are now defined using ggplot2 conventions (e.g., shape over pch).
  • base/lattice paramters are automatically remapped to their ggplot2 equivalent with a warning.
  • nrow and ncol can now be provided to control facet layout. As above, layout is automatically unpacked into ncol and nrow with a warning.
  • scales can now be provided to control facet scale restrictions. As above, x.relation and y.relation are automatically combined into scales with a warning.
  • space, axes, axis.labels, strip.position and switch are now passed to ggplot2::facet_wrap() or ggplot2::facet_grid().
Show all changes in 3.1.0Hide the rest of the changes in 3.1.0
  • title, subtitle, tag, and caption can be used throughout openair (title replacing main and caption replacing sub). All are passed through quickText() if auto.text = TRUE.
  • lineend, linejoin and linemitre tweak the appearance of line plots; see ggplot2::geom_line() for more information.
  • Additional interactions between ... parameters and various plots:
  • timePlot() now takes shape to add markers to the line chart. This can be a vector to vary with pollutant/group.
  • timeProp() now takes linewidth and linetype to control border style.
  • TheilSen() now takes linewidth, linetype, shape and alpha.
  • smoothTrend() now takes linetype, linewidth, shape and size. These can be vectors to vary based on pollutant. The linewidth of the data will always be half of that of the model.
  • Refinements to how ref.x and ref.y behave throughout {openair}:
  • ref.x and ref.y can now take a vector rather than a list, which will just use those values as the x/y intercept with default graphical parameters.
  • ref.x and ref.y have been added to timeProp() and TheilSen().
  • ref.x and ref.y can now take {ggplot2}-style parameters (intercept, alpha, colour, linetype, linewidth). The old parameter names (h/v, cols, lty and lwd) are automatically remapped so still work.
  • The non-intercept arguments passed to ref.x and ref.y (e.g., alpha) are now automatically recycled to the length of intercept, similar to how ... parameters are recycled.
  • Added refOpts() to help construct values for ref.x and ref.y, similar to windflowOpts().
  • Refinements to how breaks are implemented in functions like trendLevel():
  • If breaks doesn't cover the full range of the data being binned, the maximum and minimum breaks will be overwritten so that it does.
  • If breaks is of length 1, the colour range will be split into breaks categories, defaulting to using the same logic as running cutData() on a numeric column.
  • breaks can now take a named list, defined using the new breakOpts() function. Most significantly, this allows for the method of binning to change for single-value breaks (quantiles, equal range bins, user-defined bin widths, approximate 'pretty' breaks and wind direction binning at time of writing).
  • polarPlot(), polarAnnulus(), corPlot() and trajLevel() have gained breaks.
  • labels is no longer a top-level argument and can be defined by passing a list to breaks. labels given to ... will be converted with a warning.
  • All functions which take breaks also now contain the trans argument to perform scale transforms on continuous colour scales. This can take FALSE (no scale transform), TRUE (an appropriate default transform - usually "log10"), or a {scales} transform object (or string shorthand).
  • Refinements to colours in {openair}:
  • openColours() gains direction, alpha, begin, end, lightness and saturation for better control over colour palettes.
  • Added colourOpts(). Any cols argument in {openair} can now take the colourOpts() function, which tells each plotting function how to use the new openColours() arguments.
  • Added openSchemes() which returns a table of available colour palettes.
  • New palettes:
  • Completed the set of "viridis" palettes with "rocket" and "mako".
  • Added additional palettes by Paul Tol; "tol.highcontrast", "tol.vibrant", "tol.mediumcontrast", "tol.pale" and "tol.dark".
  • Added various palettes based on the work of Fabio Crameri - see openColours() for more details.
  • Added openColors() and colorOpts() which are synonymous with their British English equivalents openColours() and colourOpts().
  • New Kolmogorov-Zurbenko (KZ) Filter functions kzFilter() and kzaFilter(). These functions significantly enhance the capability of {openair} by allowing different time components to be separated and analysed separately. The kzFilter() function is considered a good default for a wide range of problems whereas the kzaFilter() function is the adaptive version that is well-suited to capturing abrupt changes, e.g., through an intervention. The range of uses of the filters will be covered in the {openair} book.
  • TheilSen() and smoothTrend() now use a more straightforward way to input missing data when deseason = TRUE and missing monthly data are present based on monthly linear regression by month. The user is alerted to the imputation and the monthly plot shows the imputed data as a filled grey circle.
  • smoothTrend() will now use loess when it has insufficient data to fit a GAM.
  • cutData() gains the wd.res argument, which can take one of 4, 8, or 16, defaulting to 8. 4 cuts the data into North, East, South and West. 16 cuts the data into N, NNE, NE, ENE, etc. All plotting function's type argument now responds to this, showing only four panels when wd.res = 4 and a 5x5 grid of sixteen panels when wd.res = 16.
  • trajPlot() and trajLevel() regain the map.res argument. This is passed to rnaturalearth::ne_countries() so can take three different resolutions.
  • polarPlot() will now annotate the identity of the radial axis as a caption, if annotate = TRUE.
  • ws and/or wd have been added to percentileRose(), polarAnnulus(), polarDiff() and polarFreq() in line with polarPlot().
  • angle.scale has been added to polarFreq() in line with all other polar coordinate plots.
  • The default key.position of corPlot() is now "right".
  • timePlot() has gained the key.title argument.

Bug Fixes

  • timeAverage() now has a more robust approach to multi-period averaging time such as "3 day". Bin boundaries are at fixed periods of time, which should ensure consistency across data sets that start at different times. This also means there is less need to use the argument start.date unless there is a need to extend the start date of the data for some reason e.g. to the beginning of a year. THis change may result in slight differences in returned output but should not affect periods such as "day", "hour" and "month".
  • calendarPlot() will no longer duplicate windflow arrows when type != "default".
  • calendarPlot() now supports type = "wd".
  • Fix intercept calculation in TheilSen(). Updated the intercept formula from median(y) - slope * median(x) to median(y - slope * x). This resolves a visual bug where trend lines (especially annual aggregations with negative slopes) appeared horizontally displaced due to inaccurate intercept estimates on sparse data. This fix affects the visual display of the trend lines but not the calculated slopes or uncertainties.
  • quickText() is once again tolerant of apostrophes.
  • windflowOpts() will no longer overwrite the default range of functions like calendarPlot() and trendLevel() if range is not supplied by the user.
  • polarPlot() will no longer produce a square-shaped surface when exclude.missing = FALSE.
  • fontsize is now correctly passed to scatterPlot(), polarAnnulus(), variationPlot(), and timePlot().
  • Strings with line breaks (e.g., the result of cutData(type="seasonyear"))) will no longer error when used for facet labels.
  • name.pol will now correctly map onto the names of pollutants in timeVariation().
  • windRose() now respects cols when ws2 and wd2 are provided.
  • xlim is now correctly passed to the coordinates of trajLevel().

From NEWS.md in the release

Install

Health

CRAN checks
1NOTE12OK
Check messages
NOTEdependencies in R coder-oldrel-macos-arm64
2026-05-22 11:33:01.704 R[12847:432654] XType: Using static font registry.

CRAN check page ↗

Slowest check: 6.6 min · r-oldrel-windows-x86_64
Status changes
  • NOTE12 OK, 1 NOTENow
  • NOTE12 OK, 2 NOTE2026-04-22
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
  • NOTE13 OK, 1 NOTE2026-04-03
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 3.1.0
READMEYes · 362 wordsVignettesNoNEWSYes · 100% structured · mentions 3.1.0Citation fileYes · cites a publicationWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
61 (6 internal)includes a package overview page
Examples that run
73%38 run in a plain check · 14 never run
Exported functions with examples
89%
Documented parameters
91%
Return-value docs
80%
Help pages citing references
25%

Downloads

67.5K
CRAN downloads in the past year
Rank #1,670 · ~185/day · ~5.6K/mo
Daily download trend is not available in this view yet.
4.6K30 days
13.1K90 days
67.5K1 year
Compare downloads with other packages →
Also on865 r2u2 autocran6.8K conda_forge211 c2d4u

Repository

367Stars
122Forks
26Open issues
3Open PRs
3Releases
1,859Commits
17Commit identities
air-qualitymeteorologyair-quality-dataopenairpackager
1,859 commits · Last activity 2026-10-21 · +0.8% stars, 30d · Default branch at 3.1.0.9000, ahead of CRAN 3.1.0 (checked 2026-10-18) · Discussions: 1 post
Responsiveness
How these are sampled
PRs merged (all time)
86%
Median days to close, 50 most recently updated closed issues
216
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-10-21 · 3322026-10-19 · 367
PracticesBeta

13 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/openair-project/openair on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (3)
Code of conductContributing guideIssue templates
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-18 · The repository has a site deploy workflow

pkgdown site last built 2026-10-18

CRAN release process (2)
cran-comments.mdrevdep/
Show all practicesHide 1 practice
Lint, format, editor (3)
AirVS CodeRStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
21 external dependencies (excludes base and recommended)

Installing openair adds 43 packages (23 with compiled code, 36 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, patchwork 3.2 MB.

Depends (1)
R >= 4.1.0
Imports (20)
cliclusterdplyrggplot2graphicsgrDevicesgridlubridateMASSmethodsmgcvpatchworkpurrrRcppreadrrlangscalesstatstidyrutils
LinkingTo (1)
Enhances (0)
none
Reverse dependencies
8direct
0indirect
Imports 8
Suggested by 4
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (3)
Author, Maintainer since 0.3-8 (2010)
Author · added in 2.13
Releases (94)

Pick two releases to compare their code metrics.

  • 3.1.0Latest
    record
    2026-05-20 · current release · diff ↗ ·
    added 8 exports
    breakOpts, colorOpts, colourOpts, kzFilter, kzaFilter, openColors, openSchemes, refOpts
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • R
    R 3.5.0 released · 2018-04-23
  • R
    R 3.4.0 released · 2017-04-21
  • R
    R 3.3.0 released · 2016-05-03
  • R
    R 3.2.0 released · 2015-04-16
  • R
    R 3.1.0 released · 2014-04-10
  • 3.0.3
    record
    2014-01-09 · diff ↗
  • 3.0.1
    record
    2013-04-12 · diff ↗
Show 97 earlier eventsHide 97 earlier events

Package metadata

First published
2010-09-09
Total releases
94 / 16 yrs
License
MIT + file LICENSE OSI · relicensed from GPL (>= 2) in 2.19.0
Minimum R
≥ 4.1.0
Bundled data
607 KB / 1 file
Download size
2.0 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("openair")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1016/j.envsoft.2011.09.008.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for openair version 3.1.0 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy