Skip to content

Commit

Permalink
Fixing issues with R CMD checks
Browse files Browse the repository at this point in the history
  • Loading branch information
LimaRAF committed Apr 26, 2024
1 parent 545645c commit b863587
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 37 deletions.
9 changes: 3 additions & 6 deletions R/gbifNames.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#' @source \url{https://hosted-datasets.gbif.org/datasets/backbone/current/}
#' @evalRd .readScript("data-raw/gbif/last_update.txt",
#' "Last update/change of the downloaded backbone (year-month-day):")
#' @evalRd .readScript("data-raw/gbif/df_dim_Plantae.txt",
#' "A data frame with:", "format")
#' @format An object of class \code{data.frame} with 12 columns and over 1.9 million rows.
#' @evalRd .readScript("data-raw/gbif/citation.txt", "", "references")
#'
"gbifNamesPlantae"
Expand All @@ -46,8 +45,7 @@
#' @source \url{https://hosted-datasets.gbif.org/datasets/backbone/current/}
#' @evalRd .readScript("data-raw/gbif/last_update.txt",
#' "Last update/change of the downloaded backbone (year-month-day):")
#' @evalRd .readScript("data-raw/gbif/df_dim_Fungi.txt",
#' "A data frame with:", "format")
#' @format An object of class \code{data.frame} with 12 columns and almost 400 thousand rows.
#' @evalRd .readScript("data-raw/gbif/citation.txt", "", "references")
#'
"gbifNamesFungi"
Expand All @@ -73,8 +71,7 @@
#' @source \url{https://hosted-datasets.gbif.org/datasets/backbone/current/}
#' @evalRd .readScript("data-raw/gbif/last_update.txt",
#' "Last update/change of the downloaded backbone (year-month-day):")
#' @evalRd .readScript("data-raw/gbif/df_dim_Animalia.txt",
#' "A data frame with:", "format")
#' @format An object of class \code{data.frame} with 12 columns and over 3.7 million rows.
#' @evalRd .readScript("data-raw/gbif/citation.txt", "", "references")
#'
"gbifNamesAnimalia"
3 changes: 3 additions & 0 deletions R/internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
#'
#' @keywords internal
#'
#' @importFrom httr GET content
#' @importFrom rvest html_element html_text html_text2
#'
#' @noRd
#'
.getUpdates <- function (url = NULL, source = NULL, pattern = NULL) {
Expand Down
3 changes: 1 addition & 2 deletions R/wcvpNames.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#' @source \url{https://sftp.kew.org/pub/data-repositories/WCVP/}
#' @evalRd .readScript("data-raw/wcvp/last_update.txt",
#' "Last update/change of the downloaded backbone (year-month-day):")
#' @evalRd .readScript("data-raw/wcvp/df_dim.txt",
#' "A data frame with:", "format")
#' @format An object of class \code{data.frame} with 10 columns and over 1.4 million rows.
#' @references
#' Govaerts, R., Nic Lughadha, E., Black, N. et al. (2021). The
#' World Checklist of Vascular Plants, a continuously updated
Expand Down
9 changes: 4 additions & 5 deletions R/wfoNames.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
#' @usage data(wfoNames)
#' @source \url{https://files.worldfloraonline.org/files/WFO_Backbone/_WFOCompleteBackbone/}
#' @evalRd .readScript("data-raw/wfo/last_update.txt",
#' "Last update/change of the downloaded backbone (year-month-day):")
#' @evalRd .readScript("data-raw/wfo/df_dim.txt",
#' "A data frame with:", "format")
#' "Last update of the downloaded backbone (month/day/year):")
#' @format An object of class \code{data.frame} with 11 columns and over 1.5 million rows.
#' @references
#' Borsch, T., Berendsohn, W., Dalcin, E., et al. (2020). World
#' Flora Online: Placing taxonomists at the heart of a definitive
#' and comprehensive global resource on the worlds plants. Taxon,
#' 69(6): 13111341. https://doi.org/10.1002/tax.12373
#' and comprehensive global resource on the world's plants. Taxon
#' 69: 1311-1341. https://doi.org/10.1002/tax.12373
#'
"wfoNames"
4 changes: 1 addition & 3 deletions man/gbifNamesAnimalia.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/gbifNamesFungi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/gbifNamesPlantae.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions man/plantRdata-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/wcvpNames.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions man/wfoNames.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions tests/testthat/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,27 @@ test_that("Testing .buildName", {
})

test_that("Testing .readScript", {
x <- .readScript("data-raw/wfo/last_update.txt")
testthat::expect_false(is.null(x), FALSE)
testthat::expect_error(.readScript())
testthat::expect_warning(
testthat::expect_error(.readScript("data-raw/wfo/xuxu.txt"))
testthat::expect_error(.readScript("xuxu.txt"))
)
})

test_that("Testing .getUpdates", {

url0 <- "https://files.worldfloraonline.org/files/WFO_Backbone/_WFOCompleteBackbone/"
zip <- "WFO_Backbone.zip"
last_updated <- .getUpdates(url0, "wfo", zip)
testthat::expect_equal(last_updated, "1/22/2024")

url0 <- "https://sftp.kew.org/pub/data-repositories/WCVP/"
zip <- "wcvp.zip"
last_updated <- .getUpdates(url0, "wcvp", zip)
testthat::expect_equal(last_updated, "2023-10-04")

url0 <- "https://hosted-datasets.gbif.org/datasets/backbone/current/"
zip <- "backbone.zip"
last_updated <- .getUpdates(url0, "gbif", zip)
testthat::expect_equal(last_updated, "2023-08-28")

})

0 comments on commit b863587

Please sign in to comment.