-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
71 lines (52 loc) · 2.39 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{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 <a href="https://jack-davison.github.io/ggopenair/"><img src="man/figures/logo.png" align="right" height="139" /></a>
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/ggopenair)](https://CRAN.R-project.org/package=ggopenair)
<!-- badges: end -->
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: <https://jack-davison.github.io/ggopenair/>.
```{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.