Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jack-davison/ggopenair

{ggplot2} incarnation of {openair} ☁️
https://github.com/jack-davison/ggopenair

air-quality airquality openair package r rpackage

Last synced: 23 days ago
JSON representation

{ggplot2} incarnation of {openair} ☁️

Awesome Lists containing this project

README

        

---
output: github_document
editor_options:
chunk_output_type: console
---

```{r knitropts, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/readme-",
fig.height = 4.5,
fig.align = "center"
)
```

# ggopenair: open source air quality data analysis using ggplot2

[![CRAN status](https://www.r-pkg.org/badges/version/ggopenair)](https://CRAN.R-project.org/package=ggopenair)

The goal of `ggopenair` is to bridge the gap between the data analysis functions of `openair` and the flexibility of `ggplot2`. One of the key strengths of `ggplot2` over `lattice` is that it allows plots to be manipulated *after* they are created, which allows for a much more flexible plotting experience. Unlike `lattice`, `ggplot2` is also being actively developed and extended, which `ggopenair` can take advantage of.

## Installation

You can install the development version of ggopenair from [GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
remotes::install_github("jack-davison/ggopenair")
```

## Preview

A more thorough overview of `{ggopenair}` can be found on the package website: .

```{r demo, fig.height=8, fig.width=10, echo=FALSE, warning=FALSE, message=FALSE, error=FALSE}
library(ggopenair)
library(ggplot2)
library(patchwork)

plt <- polar_plot(marylebone, "nox") + theme_polar() +
scale_y_continuous(breaks = seq(0, 12, 4))

classic <- plt + scale_opencolours_c() + ggtitle("Classic")

sqrt_trans <- plt + scale_opencolours_c(trans = c("sqrt")) +
ggtitle("Scale Transform")

steps <- plt + ggtitle("Binned") +
scale_color_stepsn(
colours = openair::openColours(),
n.breaks = 10
)

annotated <- classic + ggtitle("Annotated") +
annotate_polar_wedge("S", "W", fill = "black") +
annotate("label",
x = 225, y = 8, fill = "white", color = "red",
label = "watch out\nover here!"
)

classic + sqrt_trans + steps + annotated
```

## Code of Conduct

Please note that the ggopenair project is released with a [Contributor Code of Conduct](https://jack-davison.github.io/ggopenair/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.