From 710494f697415173ee146681b7ae7b2dc96516b2 Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:26:25 -0500 Subject: [PATCH] Remove rgdal dependency (#19) --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 92 ++++++--------------------- .github/workflows/lint.yaml | 45 +++++-------- .github/workflows/test-coverage.yaml | 60 +++++++++--------- DESCRIPTION | 16 +++-- NAMESPACE | 1 - NEWS.md | 5 ++ R/rdefra-package.R | 24 +++---- R/ukair_get_site_id.R | 2 +- README.md | 17 ++--- man/rdefra-package.Rd | 37 +++++++++++ man/rdefra.Rd | 13 ---- man/stations.Rd | 45 ++++++------- man/ukair_catalogue.Rd | 94 ++++++++++++++-------------- man/ukair_get_site_id.Rd | 2 +- tests/testthat/test-data.R | 4 +- 16 files changed, 205 insertions(+), 253 deletions(-) create mode 100644 man/rdefra-package.Rd delete mode 100644 man/rdefra.Rd diff --git a/.Rbuildignore b/.Rbuildignore index ab652a0..a8aa3d5 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,4 @@ vignettes/rdefra_vignette.Rmd.orig vignettes/precompile.R _pkgdown.yml ^\.github$ +^rdefra\.Rproj$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 7fb79c3..a3ac618 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,18 +1,10 @@ -# NOTE: This workflow is overkill for most R packages -# check-standard.yaml is likely a better choice -# usethis::use_github_action("check-standard") will install it. -# -# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. -# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: - - main - - master + branches: [main, master] pull_request: - branches: - - main - - master + branches: [main, master] name: R-CMD-check @@ -26,78 +18,32 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: windows-latest, r: '3.6'} - - {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-18.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } - - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} - - {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: - RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 - id: install-r + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Install pak and query dependencies - run: | - install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") - saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - run: | - pak::local_system_requirements(execute = TRUE) - pak::pkg_system_requirements("rcmdcheck", execute = TRUE) - shell: Rscript {0} - - - name: Install dependencies - run: | - pak::local_install_dev_deps(upgrade = TRUE) - pak::pkg_install("rcmdcheck") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_: false - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash + extra-packages: any::rcmdcheck + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 82704a1..f4c4ef2 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,49 +1,32 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: - - main - - master + branches: [main, master] pull_request: - branches: - - main - - master + branches: [main, master] name: lint jobs: lint: - runs-on: macOS-latest + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + use-public-rspm: true - - name: Install dependencies - run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("lintr") - shell: Rscript {0} - - - name: Install package - run: R CMD INSTALL . + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::lintr, local::. + needs: lint - name: Lint run: lintr::lint_package() shell: Rscript {0} + env: + LINTR_ERROR_ON_LINT: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 5910c1a..27d4528 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,48 +1,50 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: - - main - - master + branches: [main, master] pull_request: - branches: - - main - - master + branches: [main, master] name: test-coverage jobs: test-coverage: - runs-on: macOS-latest + runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::covr + needs: coverage - - name: Query dependencies + - name: Test coverage run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) shell: Rscript {0} - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies + - name: Show testthat output + if: always() run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index ff42909..09d4b4f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,13 @@ Package: rdefra -Title: Retrieve Data from the UK AIR Database -Version: 0.3.9 +Title: Interact with the UK AIR Pollution Database from DEFRA +Version: 0.3.9.9000 Authors@R: c(person(given = "Cheryl", family = "Lim", - role = c("aut", "cre"), + role = c("aut"), email = "cheryl.academic@gmail.com"), person(given = "Claudia", family = "Vitolo", - role = c("aut"), + role = c("aut", "cre"), email = "cvitolodev@gmail.com", comment = c(ORCID = "0000-0002-4252-1176", "Claudia is the original creator of the package")), person("Andrew", "Russell", role = c("ctb"), @@ -22,7 +22,6 @@ Authors@R: c(person(given = "Cheryl", person("Hao", "Zhu", role = c("ctb"), comment = "Hao Zhu reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/68")) -Maintainer: Claudia Vitolo URL: https://docs.ropensci.org/rdefra/, https://github.com/ropensci/rdefra BugReports: https://github.com/ropensci/rdefra/issues Description: This packages allows to retrieve air pollution data from the Air @@ -33,12 +32,11 @@ Description: This packages allows to retrieve air pollution data from the Air The package is described in Vitolo et al. (2016) "rdefra: Interact with the UK AIR Pollution Database from DEFRA" . Depends: R (>= 3.5.0) -Imports: lubridate, tibble, httr, xml2, dplyr, sf, rgdal, curl +Imports: lubridate, tibble, httr, xml2, dplyr, sf, curl Suggests: testthat, rmarkdown, knitr, ggplot2, zoo -SystemRequirements: GDAL VignetteBuilder: knitr LazyData: true Encoding: UTF-8 License: GPL-3 -Repository: CRAN -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.3 +Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index 2a6029b..b2ebe07 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,7 +7,6 @@ export(ukair_catalogue) export(ukair_get_coordinates) export(ukair_get_hourly_data) export(ukair_get_site_id) -import(rgdal) importFrom(curl,has_internet) importFrom(dplyr,bind_rows) importFrom(httr,GET) diff --git a/NEWS.md b/NEWS.md index ae9cc15..d426895 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +rdefra (development) +============== + +Remove dependency on rgdal. + rdefra 0.3.8 ============== diff --git a/R/rdefra-package.R b/R/rdefra-package.R index 309113e..4b4d025 100644 --- a/R/rdefra-package.R +++ b/R/rdefra-package.R @@ -1,15 +1,7 @@ -#' rdefra: Interact with the UK AIR Pollution Database from DEFRA -#' -#' The R package rdefra allows to retrieve air pollution data from the Air -#' Information Resource (UK-AIR) of the Department for Environment, Food and -#' Rural Affairs in the United Kingdom (see \url{https://uk-air.defra.gov.uk/}). -#' UK-AIR does not provide public APIs for programmatic access to data, -#' therefore this package scrapes the HTML pages to get relevant information. -#' -#' @name rdefra -#' @docType package -#' -#' @import rgdal +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start #' @importFrom curl has_internet #' @importFrom httr GET content http_error set_config config #' @importFrom utils read.csv @@ -18,7 +10,7 @@ #' @importFrom tibble as_tibble #' @importFrom dplyr bind_rows #' @importFrom sf st_as_sf st_transform st_coordinates -#' +## usethis namespace: end NULL #' List of all the DEFRA air quality monitoring stations with complete @@ -28,8 +20,6 @@ NULL #' installed in the UK and operated by DEFRA networks (as per February 2016). #' As the network expands, metadata for new stations will be added. #' -#' @usage data("stations") -#' #' @format A data frame with 6561 observations on the following 14 variables. #' \describe{ #' \item{\code{UK.AIR.ID}}{ID reference for monitoring stations} @@ -54,7 +44,7 @@ NULL #' \item{\code{SiteID}}{Site ID, used to retrieve time series data.} #' } #' -#' @keywords datasets -#' #' @source \url{https://uk-air.defra.gov.uk/} +#' @examples +#' stations "stations" diff --git a/R/ukair_get_site_id.R b/R/ukair_get_site_id.R index e2e9150..4a808a4 100644 --- a/R/ukair_get_site_id.R +++ b/R/ukair_get_site_id.R @@ -1,6 +1,6 @@ #' Get site identification numbers for DEFRA stations #' -#' @description Given the UK AIR ID (from the \code{ukair_catalogue()}), this +#' @description Given the UK AIR ID (from [ukair_catalogue()]), this #' function fetches the catalogue of monitoring stations from DEFRA's website. #' #' @param id_s An alphanumeric string (or vector of strings) containing the UK diff --git a/README.md b/README.md index 08fe497..33ed61a 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.593187.svg)](https://doi.org/10.5281/zenodo.593187) [![JOSS](https://joss.theoj.org/papers/10.21105/joss.00051/status.svg)](https://doi.org/10.21105/joss.00051) -[![R-CMD-check](https://github.com/ropensci/rdefra/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/rdefra/actions) -[![codecov.io](https://codecov.io/gh/ropensci/rdefra/coverage.svg?branch=master)](https://codecov.io/gh/ropensci/rdefra?branch=master) - + +[![R-CMD-check](https://github.com/ropensci/rdefra/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/rdefra/actions/workflows/R-CMD-check.yaml) +[![codecov.io](https://codecov.io/gh/ropensci/rdefra/coverage.svg?branch=master)](https://app.codecov.io/gh/ropensci/rdefra?branch=master) [![CRAN Status Badge](http://www.r-pkg.org/badges/version/rdefra)](https://cran.r-project.org/package=rdefra) [![CRAN Total @@ -13,6 +13,7 @@ Downloads](http://cranlogs.r-pkg.org/badges/grand-total/rdefra)](https://cran.r- [![CRAN Monthly Downloads](http://cranlogs.r-pkg.org/badges/rdefra)](https://cran.r-project.org/package=rdefra) [![](https://badges.ropensci.org/68_status.svg)](https://github.com/ropensci/software-review/issues/68) + The package [rdefra](https://cran.r-project.org/package=rdefra) allows to retrieve air pollution data from the Air Information Resource @@ -36,7 +37,7 @@ DEFRA’s servers can handle multiple data requests, therefore concurrent calls can be sent simultaneously using the [parallel](https://www.R-project.org/) package. Although the limit rate depends on the maximum number of concurrent calls, traffic and available -infrustracture, data retrieval is very efficient. Multiple years of data +infrastructure, data retrieval is very efficient. Multiple years of data for hundreds of sites can be downloaded in only few minutes. For similar functionalities see also the @@ -65,13 +66,13 @@ remotes::install_github("ropensci/rdefra") Load the rdefra package: ``` r -library("rdefra") +library(rdefra) ``` ## Functions The package logic assumes that users access the UK-AIR database in the -fllowing steps: +following steps: 1. Browse the catalogue of available stations and selects some stations of interest (see function `ukair_catalogue()`). @@ -79,7 +80,7 @@ fllowing steps: 3. Retrieves data for the selected stations (see functions `ukair_get_site_id()` and `ukair_get_hourly_data()`). -For an in-depth description of the various functionalities andexample +For an in-depth description of the various functionalities and example applications, please refer to the package [vignette](https://github.com/ropensci/rdefra/blob/master/vignettes/rdefra_vignette.Rmd). @@ -88,7 +89,7 @@ applications, please refer to the package - 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) + - License: [GPL-3](https://opensource.org/license/gpl-3-0/) - This package was reviewed by [Maëlle Salmon](https://github.com/maelle) and [Hao Zhu](https://github.com/haozhu233) for submission to ROpenSci (see diff --git a/man/rdefra-package.Rd b/man/rdefra-package.Rd new file mode 100644 index 0000000..bc635dd --- /dev/null +++ b/man/rdefra-package.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/rdefra-package.R +\docType{package} +\name{rdefra-package} +\alias{rdefra} +\alias{rdefra-package} +\title{rdefra: Interact with the UK AIR Pollution Database from DEFRA} +\description{ +This packages allows to retrieve air pollution data from the Air Information Resource (UK-AIR, \url{https://uk-air.defra.gov.uk/}) of the Department for Environment, Food and Rural Affairs (DEFRA) in the United Kingdom. UK-AIR does not provide a public API for programmatic access to data, therefore this package scrapes the HTML pages to get relevant information. The package is described in Vitolo et al. (2016) "rdefra: Interact with the UK AIR Pollution Database from DEFRA" \doi{10.21105/joss.00051}. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://docs.ropensci.org/rdefra/} + \item \url{https://github.com/ropensci/rdefra} + \item Report bugs at \url{https://github.com/ropensci/rdefra/issues} +} + +} +\author{ +\strong{Maintainer}: Claudia Vitolo \email{cvitolodev@gmail.com} (\href{https://orcid.org/0000-0002-4252-1176}{ORCID}) (Claudia is the original creator of the package) + +Authors: +\itemize{ + \item Cheryl Lim \email{cheryl.academic@gmail.com} +} + +Other contributors: +\itemize{ + \item Andrew Russell (This package is part of the KEHRA project and Andrew supervised the technical/software development.) [contributor] + \item Allan Tucker (This package is part of the KEHRA project and Allan supervised the technical/software development.) [contributor] + \item Maëlle Salmon (Maëlle Salmon reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/68) [contributor] + \item Hao Zhu (Hao Zhu reviewed the package for rOpenSci, see https://github.com/ropensci/software-review/issues/68) [contributor] +} + +} +\keyword{internal} diff --git a/man/rdefra.Rd b/man/rdefra.Rd deleted file mode 100644 index 29b9a2f..0000000 --- a/man/rdefra.Rd +++ /dev/null @@ -1,13 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/rdefra-package.R -\docType{package} -\name{rdefra} -\alias{rdefra} -\title{rdefra: Interact with the UK AIR Pollution Database from DEFRA} -\description{ -The R package rdefra allows to retrieve air pollution data from the Air -Information Resource (UK-AIR) of the Department for Environment, Food and -Rural Affairs in the United Kingdom (see \url{https://uk-air.defra.gov.uk/}). -UK-AIR does not provide public APIs for programmatic access to data, -therefore this package scrapes the HTML pages to get relevant information. -} diff --git a/man/stations.Rd b/man/stations.Rd index 8b060de..93924ab 100644 --- a/man/stations.Rd +++ b/man/stations.Rd @@ -8,37 +8,40 @@ coordinates} \format{ A data frame with 6561 observations on the following 14 variables. \describe{ - \item{\code{UK.AIR.ID}}{ID reference for monitoring stations} - \item{\code{EU.Site.ID}}{EU.Site.ID} - \item{\code{EMEP.Site.ID}}{EMEP.Site.ID} - \item{\code{Site.Name}}{Site name} - \item{\code{Environment.Type}}{a factor with levels \code{Background Rural} - \code{Background Suburban} \code{Background Urban} - \code{Industrial Suburban} \code{Industrial Unknown} - \code{Industrial Urban} \code{Traffic Urban} \code{Unknown Unknown}} - \item{\code{Zone}}{Zone} - \item{\code{Start.Date}}{Start date} - \item{\code{End.Date}}{End date} - \item{\code{Latitude}}{Latitude (WGS 84)} - \item{\code{Longitude}}{Longitude (WGS 84)} - \item{\code{Northing}}{Northing coordinate (British National Grid)} - \item{\code{Easting}}{Easting coordinate (British National Grid)} - \item{\code{Altitude..m.}}{Altitude in metres above sea level} - \item{\code{Networks}}{Monitoring Networks} - \item{\code{AURN.Pollutants.Measured}}{Pollutant measured} - \item{\code{Site.Description}}{Description of the site.} - \item{\code{SiteID}}{Site ID, used to retrieve time series data.} +\item{\code{UK.AIR.ID}}{ID reference for monitoring stations} +\item{\code{EU.Site.ID}}{EU.Site.ID} +\item{\code{EMEP.Site.ID}}{EMEP.Site.ID} +\item{\code{Site.Name}}{Site name} +\item{\code{Environment.Type}}{a factor with levels \code{Background Rural} +\code{Background Suburban} \code{Background Urban} +\code{Industrial Suburban} \code{Industrial Unknown} +\code{Industrial Urban} \code{Traffic Urban} \code{Unknown Unknown}} +\item{\code{Zone}}{Zone} +\item{\code{Start.Date}}{Start date} +\item{\code{End.Date}}{End date} +\item{\code{Latitude}}{Latitude (WGS 84)} +\item{\code{Longitude}}{Longitude (WGS 84)} +\item{\code{Northing}}{Northing coordinate (British National Grid)} +\item{\code{Easting}}{Easting coordinate (British National Grid)} +\item{\code{Altitude..m.}}{Altitude in metres above sea level} +\item{\code{Networks}}{Monitoring Networks} +\item{\code{AURN.Pollutants.Measured}}{Pollutant measured} +\item{\code{Site.Description}}{Description of the site.} +\item{\code{SiteID}}{Site ID, used to retrieve time series data.} } } \source{ \url{https://uk-air.defra.gov.uk/} } \usage{ -data("stations") +stations } \description{ This is the list of all the air quality monitoring stations ever installed in the UK and operated by DEFRA networks (as per February 2016). As the network expands, metadata for new stations will be added. } +\examples{ +stations +} \keyword{datasets} diff --git a/man/ukair_catalogue.Rd b/man/ukair_catalogue.Rd index d22d529..f63f619 100644 --- a/man/ukair_catalogue.Rd +++ b/man/ukair_catalogue.Rd @@ -47,61 +47,61 @@ DEFRA's website. \details{ The argument \code{Pollutant} is defined based on the following convention: \itemize{ - \item{1 = Ozone (O3)} - \item{2 = Nitrogen oxides (NOx)} - \item{3 = Carbon monoxide (CO)} - \item{4 = Sulphur dioxide (SO2)} - \item{5 = Particulate Matter (PM10)} - \item{6 = Particulate Matter (PM2.5)} - \item{7 = PAHs} - \item{8 = Metals in PM10} - \item{9 = Benzene} - \item{10 = Black Carbon} +\item{1 = Ozone (O3)} +\item{2 = Nitrogen oxides (NOx)} +\item{3 = Carbon monoxide (CO)} +\item{4 = Sulphur dioxide (SO2)} +\item{5 = Particulate Matter (PM10)} +\item{6 = Particulate Matter (PM2.5)} +\item{7 = PAHs} +\item{8 = Metals in PM10} +\item{9 = Benzene} +\item{10 = Black Carbon} } The argument \code{group_id} is defined based on the following convention: \itemize{ - \item{1 = UKEAP: Precip-Net} - \item{2 = Air Quality Strategy Pollutants} - \item{3 = Ammonia and Nitric Acid} - \item{4 = Automatic Urban and Rural Monitoring Network (AURN)} - \item{5 = Dioxins and Furans} - \item{6 = Black Smoke & SO2} - \item{7 = Automatic Hydrocarbon Network} - \item{8 = Heavy Metals} - \item{9 = Nitrogen Dioxide Diffusion Tube} - \item{10 = PAH Andersen} - \item{11 = Particle Size Composition} - \item{12 = PCBs} - \item{13 = TOMPs} - \item{14 = Non-Automatic Hydrocarbon Network} - \item{15 = 1,3-Butadiene Diffusion Tube} - \item{16 = Black Carbon} - \item{17 = Automatic Urban and Rural Monitoring Network (AURN)} - \item{18 = Defra NO2 Diffusion Tube} - \item{19 = PAH Digitel (solid phase)} - \item{20 = PAH Digitel (solid+vapour)} - \item{21 = PAH Deposition} - \item{22 = Particle size and number} - \item{23 = Rural Automatic Mercury network} - \item{24 = Urban Sulphate} - \item{25 = UKEAP: Rural NO2} - \item{26 = Automatic Urban and Rural Monitoring Network (AURN)} - \item{27 = UKEAP: National Ammonia Monitoring Network} - \item{28 = UKEAP: Acid Gases & Aerosol Network} - \item{29 = Particle Speciation (MARGA)} - \item{30 = UKEAP: Historic Aerosol measurements} +\item{1 = UKEAP: Precip-Net} +\item{2 = Air Quality Strategy Pollutants} +\item{3 = Ammonia and Nitric Acid} +\item{4 = Automatic Urban and Rural Monitoring Network (AURN)} +\item{5 = Dioxins and Furans} +\item{6 = Black Smoke & SO2} +\item{7 = Automatic Hydrocarbon Network} +\item{8 = Heavy Metals} +\item{9 = Nitrogen Dioxide Diffusion Tube} +\item{10 = PAH Andersen} +\item{11 = Particle Size Composition} +\item{12 = PCBs} +\item{13 = TOMPs} +\item{14 = Non-Automatic Hydrocarbon Network} +\item{15 = 1,3-Butadiene Diffusion Tube} +\item{16 = Black Carbon} +\item{17 = Automatic Urban and Rural Monitoring Network (AURN)} +\item{18 = Defra NO2 Diffusion Tube} +\item{19 = PAH Digitel (solid phase)} +\item{20 = PAH Digitel (solid+vapour)} +\item{21 = PAH Deposition} +\item{22 = Particle size and number} +\item{23 = Rural Automatic Mercury network} +\item{24 = Urban Sulphate} +\item{25 = UKEAP: Rural NO2} +\item{26 = Automatic Urban and Rural Monitoring Network (AURN)} +\item{27 = UKEAP: National Ammonia Monitoring Network} +\item{28 = UKEAP: Acid Gases & Aerosol Network} +\item{29 = Particle Speciation (MARGA)} +\item{30 = UKEAP: Historic Aerosol measurements} } The argument \code{country_id} is defined based on the following convention: \itemize{ - \item{1 = England} - \item{2 = Wales} - \item{3 = Scotland} - \item{4 = Northern Ireland} - \item{5 = Republic of Ireland} - \item{6 = Channel Islands} - } +\item{1 = England} +\item{2 = Wales} +\item{3 = Scotland} +\item{4 = Northern Ireland} +\item{5 = Republic of Ireland} +\item{6 = Channel Islands} +} } \examples{ \dontrun{ diff --git a/man/ukair_get_site_id.Rd b/man/ukair_get_site_id.Rd index e89c8a9..d5e28ca 100644 --- a/man/ukair_get_site_id.Rd +++ b/man/ukair_get_site_id.Rd @@ -14,7 +14,7 @@ AIR ID defined by DEFRA.} A named vector containing the site id_s. } \description{ -Given the UK AIR ID (from the \code{ukair_catalogue()}), this +Given the UK AIR ID (from \code{\link[=ukair_catalogue]{ukair_catalogue()}}), this function fetches the catalogue of monitoring stations from DEFRA's website. } \examples{ diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R index c014d1f..4860be1 100644 --- a/tests/testthat/test-data.R +++ b/tests/testthat/test-data.R @@ -34,8 +34,8 @@ test_that("Try and retrieve hourly data for 2 years", { if ("try-error" %in% class(x) | is.null(class(x))) { skip("Call to ukair_get_hourly_data for 2 years failed!") }else{ - expect_true("data.frame" %in% class(x)) - expect_true(all(dim(x) == c(17544, 20))) + expect_s3_class(x, "data.frame") + expect_equal(dim(x), c(17544, 20)) } })