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

Commit

Permalink
V0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cvitolo committed Sep 7, 2016
1 parent 960b1b6 commit 3a19a58
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 12 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.travis.yml
README_files
README_cache
assets
cran-comments.md
preparePackage.R
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: rdefra
Title: Interact with the UK AIR Pollution Database from DEFRA
Version: 0.3.2
Version: 0.3.3
Authors@R: c(person("Claudia", "Vitolo", email = "[email protected]", role = c("aut", "cre")),
person("Andrew", "Russell", role = c("ctb"), comment = "This package is part of the KEHRA project and Andrew supervised the technical/software development."),
person("Allan", "Tucker", role = c("ctb"), comment = "This package is part of the KEHRA project and Allan supervised the technical/software development."),
person("Maëlle", "Salmon", role = c("ctb"), comment = "Maëlle Salmon reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/68"),
person("Hao", "Zhu", role = c("ctb"), comment = "Hao Zhu reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/68"))
Maintainer: Claudia Vitolo <[email protected]>
URL: https://github.com/kehraProject/r_rdefra
BugReports: https://github.com/kehraProject/r_rdefra/issues
URL: https://github.com/kehraProject/rdefra
BugReports: https://github.com/kehraProject/rdefra/issues
Description: Get data from DEFRA's UK-AIR website (https://uk-air.defra.gov.uk/). It basically scraps the HTML content.
Depends: R (>= 2.10)
Imports: lubridate, tibble, httr, xml2, dplyr, sp
Expand Down
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# rdefra 0.3.3

In this release the package was moved to the root directory (needed based on the ropensci review) and the related adjustments made.

# rdefra 0.3.2

Accepted for pubblication on JOSS

# rdefra 0.3.1

Minor changes

# rdefra 0.3.0

Minor fixes

# rdefra 0.2.0

* Added unist tests (using testthat framework),
Expand Down
12 changes: 9 additions & 3 deletions R/ukair_catalogue.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,21 @@ ukair_catalogue <- function(site_name = "", pollutant = 9999, group_id = 9999,
closed = "true", country_id = 9999, region_id = 9999){

if (!(pollutant %in% 1:10 | pollutant == 9999)) {
stop("The parameter 'polluntant' is not set correctly, valid values are integers between 1 and 10 (see documentation) or 9999 (all pollutants).")
stop(paste("The parameter 'polluntant' is not set correctly,",
"valid values are integers between 1 and 10 (see documentation)",
"or 9999 (all pollutants)."))
}

if (!(group_id %in% 1:30 | group_id == 9999)) {
stop("The parameter 'group_id' is not set correctly, valid values are integers between 1 and 30 (see documentation) or 9999 (all groups).")
stop(paste("The parameter 'group_id' is not set correctly, valid values",
"are integers between 1 and 30 (see documentation) or 9999",
"(all groups)."))
}

if (!(country_id %in% 1:6 | country_id == 9999)) {
stop("The parameter 'country_id' is not set correctly, valid values are integers between 1 and 6 (see documentation) or 9999 (all countries).")
stop(paste("The parameter 'country_id' is not set correctly, valid values",
"are integers between 1 and 6 (see documentation) or 9999 (all",
"countries)."))
}

# Any NULL elements of the list supplied to the query paramater are
Expand Down
5 changes: 3 additions & 2 deletions R/ukair_get_coordinates.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ukair_get_coordinates <- function(ids, en = FALSE, all_coords = FALSE){
IDs <- as.character(IDs)

# Get Easting and Northing
enDF <- data.frame(t(sapply(IDs, ukair_get_coordinates_internal)))
enDF <- data.frame(t(vapply(IDs, ukair_get_coordinates_internal)))

# Remove NAs
rowsNoNAs <- which(!is.na(enDF$Easting) & !is.na(enDF$Northing))
Expand All @@ -62,7 +62,8 @@ ukair_get_coordinates <- function(ids, en = FALSE, all_coords = FALSE){
sp::coordinates(enDFnoNAs) <- ~Easting+Northing
sp::proj4string(enDFnoNAs) <- sp::CRS("+init=epsg:27700")
# then, convert coordinates from British National Grid to WGS84
latlon <- round(sp::spTransform(enDFnoNAs, sp::CRS("+init=epsg:4326"))@coords, 6)
latlon <- round(sp::spTransform(enDFnoNAs,
sp::CRS("+init=epsg:4326"))@coords, 6)
pt <- data.frame(latlon)
names(pt) <- c("Longitude", "Latitude")

Expand Down
2 changes: 1 addition & 1 deletion R/ukair_get_site_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ukair_get_site_id <- function(IDs){

IDs <- as.character(IDs)

enDF <- t(sapply(IDs, ukair_get_site_id_internal))
enDF <- t(vapply(IDs, ukair_get_site_id_internal))

return(as.character(enDF))

Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a resubmission after adapting the package to make it suitable for inclusion in the ropensci framework.
This is a resubmission after adapting the package to make it suitable for inclusion in the ropensci framework and publication in JOSS.

---------------------------------

Expand Down
4 changes: 2 additions & 2 deletions vignettes/rdefra_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ df <- bind_rows(myList)

## Meta

* Please note that this project is released with a [Contributor Code of Conduct](rdefra/CONDUCT.md). By participating in this project you agree to abide by its terms.
* Please [report any issues or bugs](https://github.com/kehraProject/r_rdefra/issues).
* 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.
* Please [report any issues or bugs](https://github.com/kehraProject/rdefra/issues).
* License: [GPL-3](https://opensource.org/licenses/GPL-3.0)
* Get citation information for `rdefra` in R doing `citation(package = 'rdefra')`

0 comments on commit 3a19a58

Please sign in to comment.