Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Remove pre-generated images from vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
cvitolo committed Apr 5, 2020
1 parent 64b4249 commit 6c33b2c
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 68 deletions.
11 changes: 2 additions & 9 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
^README\.Rmd$
^CONDUCT\.md$
^.*\.Rproj$
^\.Rproj\.user$
^appveyor\.yml$
^\.travis\.yml$

cache$
assets
cran-comments.md
preparePackage.R
reviewJOSS.md
reviewROPENSCI.md
inst/extdata
inst/paper
BugFixing.R
_pkgdown.yml
^docs$
vignettes/rdefra_vignette.R
vignettes/rdefra_vignette.html
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
.Rproj.user
.Rhistory
.RData

*.Rproj
*.tar.gz

*.html

README_cache/*
vignettes/rdefra_vignette_cache/*
vignettes/*.R
vignettes/*.md
vignettes/figure/*
BugFixing.R

# Remove docs folder (site builds automatically)
docs/*
25 changes: 0 additions & 25 deletions CONDUCT.md

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rdefra
Title: Interact with the UK AIR Pollution Database from DEFRA
Version: 0.3.7
Version: 0.3.8
Authors@R: c(person(given = "Claudia",
family = "Vitolo",
role = c("aut", "cre"),
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
rdefra 0.3.7
rdefra 0.3.8
==============

## BUG FIXES
* Updated tests to be compatible with PROJ6 [#9](https://github.com/ropensci/rdefra/issues/9)

## MINOR CHANGES
* Removed obsolete packages in 'Suggests'
* Fixed invalid URIs
* The following directory looks like a leftover from knitr

rdefra 0.3.6
==============
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,11 @@ fllowing steps:

For an in-depth description of the various functionalities andexample
applications, please refer to the package
[vignette](vignettes/rdefra_vignette.md).
[vignette](vignettes/rdefra_vignette.Rmd).

## Meta

- Please note that this project is released with a [Contributor Code
of Conduct](CONDUCT.md). By participating in this project you agree
to abide by its terms.
- This package and functions herein are part of an experimental open-source project. They are provided as is, without any guarantee.
- Please [report any issues or
bugs](https://github.com/ropensci/rdefra/issues).
- License: [GPL-3](https://opensource.org/licenses/GPL-3.0)
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This is a resubmission due to bug fixing.

## MINOR CHANGES
* Removed obsolete packages in 'Suggests'
* Fixed invalid URIs
* The following directory looks like a leftover from knitr

## Test environment
* Ubuntu 18.04, R 3.6.3
Expand Down
Binary file removed vignettes/map.png
Binary file not shown.
Binary file removed vignettes/ozone.png
Binary file not shown.
20 changes: 7 additions & 13 deletions vignettes/rdefra_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{rdefra}
%\VignetteEngine{knitr::knitr}
%\usepackage[UTF-8]{inputenc}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r setup, echo = FALSE}
Expand Down Expand Up @@ -138,7 +138,7 @@ plot(daily_means, main = "", xlab = "",

The above figure \ref{fig:hdata} shows the highest concentrations happen in late spring and at the beginning of summer. In order to check whether this happens every year, we can download multiple years of data and then compare them.

```{r ozone_data, eval = FALSE}
```{r ozone_data, eval = TRUE}
# Get 15 years of hourly ozone data from the same monitoring station
library("ggplot2")
library("dplyr")
Expand All @@ -157,11 +157,8 @@ df %>%
geom_boxplot(aes(x = as.factor(month), y = ozone, group = month),
outlier.shape = NA) +
xlab("Month of the year") +
ylab(expression(paste("Ozone concentration (", mu, "g/",m^3,")")))
```

```{r ozone, echo = FALSE, eval = TRUE, fig.width = 7, out.width = "600px", fig.cap = "\\label{fig:ozone}15 years of hourly ozone data from London Marylebone Road monitoring station."}
knitr::include_graphics("ozone.png")
ylab(expression(paste("Ozone concentration (", mu, "g/",m^3,")"))) +
ggtitle("15 years of hourly ozone data from London Marylebone Road monitoring station")
```

The above box plots show that the highest concentrations usually occurr during April/May and that these vary year-by-year.
Expand All @@ -172,13 +169,14 @@ The above box plots show that the highest concentrations usually occurr during A

After scraping DEFRA's web pages, almost all the stations have valid coordinates. In the figure below, blue circles show all the stations with valid coordinates, while red circles show stations with available hourly data.

```{r map_data, eval = FALSE}
```{r map_data, eval = TRUE}
# Keep only station with coordinates
stations_with_coords <- stations[complete.cases(stations[, c("Longitude",
"Latitude")]), ]
# Keep only station with known SiteID
stations_with_SiteID <- which(!is.na(stations_with_coords$SiteID))
# Blue circles show stations with valid coordinates, while red circles show stations with available hourly data.
library("leaflet")
leaflet(data = stations_with_coords) %>% addTiles() %>%
addCircleMarkers(lng = ~Longitude,
Expand All @@ -191,10 +189,6 @@ leaflet(data = stations_with_coords) %>% addTiles() %>%
popup = ~SiteID[stations_with_SiteID])
```

```{r map, echo = FALSE, eval = TRUE, fig.width = 7, out.width = "600px", fig.cap = "\\label{fig:map}Blue circles show stations with valid coordinates, while red circles show stations with available hourly data."}
knitr::include_graphics("map.png")
```

### Analyse the spatial distribution of the monitoring stations

Below are two plots showing the spatial distribution of the monitoring stations. These are concentrated largely in urban areas and mostly estimate the background level of concentration of pollutants.
Expand Down

0 comments on commit 6c33b2c

Please sign in to comment.