diff --git a/.Rbuildignore b/.Rbuildignore index e29a392..2968689 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -5,6 +5,7 @@ .travis.yml README_files +README_cache assets cran-comments.md preparePackage.R diff --git a/DESCRIPTION b/DESCRIPTION index 5f08604..807fc9f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "cvitolodev@gmail.com", 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 -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 diff --git a/NEWS.md b/NEWS.md index a49ff0e..477fa19 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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), diff --git a/R/ukair_catalogue.R b/R/ukair_catalogue.R index cbfc843..363872e 100644 --- a/R/ukair_catalogue.R +++ b/R/ukair_catalogue.R @@ -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 diff --git a/R/ukair_get_coordinates.R b/R/ukair_get_coordinates.R index 50c98c5..7b8c9d6 100644 --- a/R/ukair_get_coordinates.R +++ b/R/ukair_get_coordinates.R @@ -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)) @@ -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") diff --git a/R/ukair_get_site_id.R b/R/ukair_get_site_id.R index a65e72c..f14f0cd 100644 --- a/R/ukair_get_site_id.R +++ b/R/ukair_get_site_id.R @@ -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)) diff --git a/cran-comments.md b/cran-comments.md index 3a4af9e..371dd3d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -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. --------------------------------- diff --git a/vignettes/rdefra_vignette.Rmd b/vignettes/rdefra_vignette.Rmd index dc391ff..445a16a 100644 --- a/vignettes/rdefra_vignette.Rmd +++ b/vignettes/rdefra_vignette.Rmd @@ -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')`