Skip to content

Commit

Permalink
chore: add alt text & use pak
Browse files Browse the repository at this point in the history
Adds alt text to images in README, and prefers the use of pak over devtools
  • Loading branch information
jack-davison committed Jun 22, 2023
1 parent bf6bff5 commit 425f81a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
12 changes: 7 additions & 5 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ knitr::opts_chunk$set(
)
```

# openairmaps: tools to create maps of air pollution data <img src="man/figures/logo.png" align="right" height="134" />
# openairmaps: tools to create maps of air pollution data <img src="man/figures/logo.png" align="right" height="134" alt="the openairmaps logo. It shows a stylised pollution rose overlaid with a typical teardrop shaped map marker." />

<!-- badges: start -->
[![R-CMD-check](https://github.com/davidcarslaw/openairmaps/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/davidcarslaw/openairmaps/actions/workflows/R-CMD-check.yaml)
Expand All @@ -36,8 +36,8 @@ install.packages("openairmaps")
You can install the development version of `{openairmaps}` from GitHub with:

``` r
# install.packages("devtools")
devtools::install_github("davidcarslaw/openairmaps")
# install.packages("pak")
pak::pak("davidcarslaw/openairmaps")
```

## Overview
Expand All @@ -64,11 +64,13 @@ polar_data %>%
)
```

![An example `polarMap()` showing NO2 concentrations in central London.](man/figures/README-examplemap.png)
```{r egreal, echo = FALSE, fig.cap="An example `polarMap()` showing NO2 concentrations in central London.", fig.alt="A screenshot of a leaflet map. It shows an OpenStreetMap map layer, overlaid with bivariate polar plots. Polar plots are visualisations on polar coordinates with wind direction on the spoke axes, wind speed on the radial axes, and a smooth surface showing pollutant concentrations. A menu is found at the top-right of the map, which allows users to swap between daylight and nighttime observations."}
knitr::include_graphics("man/figures/README-examplemap.png")
```
While an interactive map is preferred for exploratory directional analysis, it is limited to the HTML format. Some applications (for example, academic journals) demand "static" formats like .docx and .pdf. For this reason, "static" versions of `{openairmaps}` polar marker functions have been provided which are written in `{ggplot2}`. A benefit of being written in `{ggplot2}` is that additional layers can be added (e.g., `geom_label()` could be used to label sites) and limited further customisation is available using `theme()` and `guides()`.
```{r static, fig.width = 9, fig.height = 5, message = FALSE, warning = FALSE}
```{r static, fig.width = 9, fig.height = 5, message = FALSE, warning = FALSE, fig.cap="A demonstration of `polarMapStatic()`.", fig.alt="A natively static polar plot map. It shows an OpenStreetMap map layer, overlaid with bivariate polar plots. Polar plots are visualisations on polar coordinates with wind direction on the spoke axes, wind speed on the radial axes, and a smooth surface showing pollutant concentrations. The map is split into two, with one panel for daylight observations and the other for nighttime."}
polar_data %>%
openair::cutData("daylight") %>%
polarMapStatic(
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# openairmaps: tools to create maps of air pollution data <img src="man/figures/logo.png" align="right" height="134" />
# openairmaps: tools to create maps of air pollution data <img src="man/figures/logo.png" align="right" height="134" alt="the openairmaps logo. It shows a stylised pollution rose overlaid with a typical teardrop shaped map marker." />

<!-- badges: start -->

Expand Down Expand Up @@ -30,8 +30,8 @@ You can install the development version of `{openairmaps}` from GitHub
with:

``` r
# install.packages("devtools")
devtools::install_github("davidcarslaw/openairmaps")
# install.packages("pak")
pak::pak("davidcarslaw/openairmaps")
```

## Overview
Expand Down Expand Up @@ -64,8 +64,14 @@ polar_data %>%
)
```

![An example `polarMap()` showing NO2 concentrations in central
London.](man/figures/README-examplemap.png)
<div class="figure">

<img src="man/figures/README-examplemap.png" alt="A screenshot of a leaflet map. It shows an OpenStreetMap map layer, overlaid with bivariate polar plots. Polar plots are visualisations on polar coordinates with wind direction on the spoke axes, wind speed on the radial axes, and a smooth surface showing pollutant concentrations. A menu is found at the top-right of the map, which allows users to swap between daylight and nighttime observations." width="100%" />
<p class="caption">
An example `polarMap()` showing NO2 concentrations in central London.
</p>

</div>

While an interactive map is preferred for exploratory directional
analysis, it is limited to the HTML format. Some applications (for
Expand All @@ -89,4 +95,11 @@ polar_data %>%
)
```

<img src="man/figures/README-static-1.png" width="100%" />
<div class="figure">

<img src="man/figures/README-static-1.png" alt="A natively static polar plot map. It shows an OpenStreetMap map layer, overlaid with bivariate polar plots. Polar plots are visualisations on polar coordinates with wind direction on the spoke axes, wind speed on the radial axes, and a smooth surface showing pollutant concentrations. The map is split into two, with one panel for daylight observations and the other for nighttime." width="100%" />
<p class="caption">
A demonstration of `polarMapStatic()`.
</p>

</div>

0 comments on commit 425f81a

Please sign in to comment.