Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Description: Provides an interface to the public APIs of the European and
users to retrieve EPPO data by accessing specific services and datasets. The
package also includes utilities for data wrangling, including the
integration of taxonomy with rank information. See
<[https://data.eppo.int/apis/]https://data.eppo.int/apis/> for more details.
<https://data.eppo.int/apis/> for more details.
License: EUPL-1.2
URL: https://openefsa.github.io/eppoFindeR/
BugReports: https://github.com/openefsa/eppoFindeR/issues
Expand Down
13 changes: 0 additions & 13 deletions R/buildEndpoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@
#' @importFrom checkmate assert_string
#' @importFrom glue glue
#'
#' @examplesIf FALSE
#' # Basic endpoint.
#' endpoint_ <- .buildEndpoint(basePath = "/taxons/list")
#'
#' # Endpoint with resource identifier.
#' endpoint_ <- .buildEndpoint(basePath = "/taxons/taxon", code = "BEMITA")
#'
#' # Endpoint with code and service.
#' endpoint_ <- .buildEndpoint(
#' basePath = "/taxons/taxon",
#' code = "BEMITA",
#' service = "names")
#'
#' @keywords internal
#' @noRd
#'
Expand Down
9 changes: 0 additions & 9 deletions R/buildReportingServicePath.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
#'
#' @importFrom checkmate assert_string assert_list
#' @importFrom glue glue
#'
#' @examplesIf FALSE
#' # Fetch reporting data about the article with ID = 10.
#' reportingServicePath_ <- .buildReportingServicePath(
#' service = "article",
#' params = list(
#' article_id = 10
#' )
#' )
#'
#' @keywords internal
#' @noRd
Expand Down
10 changes: 0 additions & 10 deletions R/buildRequest.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@
#' @importFrom checkmate assert_string assert_vector assert_list
#' @importFrom httr2 request req_method req_headers req_error resp_status
#' req_url_query
#'
#' @examplesIf FALSE
#' url_ <- "https://api.eppo.int/gd/v2/taxon/BEMITA"
#' apiKey_ <- "YOUR_API_KEY"
#' doNotFailOn_ <- c(200, 400, 401, 403, 404, 429, 500)
#'
#' request_ <- .buildRequest(
#' url = url_,
#' apiKey = apiKey_,
#' doNotFailOn = doNotFailOn_)
#'
#' @keywords internal
#' @noRd
Expand Down
4 changes: 0 additions & 4 deletions R/checkServices.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#'
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' .checkServices(c("a", "b"), c("a", "b", "c")) # Valid.
#' .checkServices(c("a", "x"), c("a", "b", "c")) # Error.
#'
#' @keywords internal
#' @noRd
#'
Expand Down
4 changes: 3 additions & 1 deletion R/country.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#' @importFrom checkmate assert_vector assert_string
#' @importFrom purrr map set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get all information about France.
#' countryData_ <- country(isoCodes = c("FR"))
#'
Expand All @@ -44,6 +45,7 @@
#'
#' # Get basic data about France and Italy.
#' countryData_ <- country(isoCodes = c("FR", "IT"), services = c("overview"))
#' }
#'
#' @export
#'
Expand Down
7 changes: 0 additions & 7 deletions R/enrichResponse.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
#' queried, and `queried_url`, the URL used for the API request.
#'
#' @importFrom checkmate assert assert_string check_list check_data_frame
#'
#' @examplesIf FALSE
#' data_ <- list(name = "example", value = 123)
#'
#' enrichedData_ <- .enrichResponse(
#' responseData = data_,
#' url = "https://example.org")
#'
#' @keywords internal
#' @noRd
Expand Down
9 changes: 0 additions & 9 deletions R/fetchService.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@
#' service.
#'
#' @importFrom checkmate assert_string assert_list
#'
#' @examplesIf FALSE
#' # Fetch country information about France.
#' serviceData_ <- .fetchService(
#' basePath = "/country",
#' code = "FR",
#' service = "overview",
#' apiKey = "YOUR_API_KEY"
#' )
#'
#' @keywords internal
#' @noRd
Expand Down
4 changes: 3 additions & 1 deletion R/general.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
#' @importFrom checkmate assert_vector assert_string
#' @importFrom purrr map set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get information about system health status.
#' generalData_ <- general()
#' }
#'
#' @export
#'
Expand Down
8 changes: 0 additions & 8 deletions R/groupByServices.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
#' @importFrom purrr map imap
#' @importFrom checkmate assert_list
#' @importFrom dplyr bind_rows relocate
#'
#' @examplesIf FALSE
#' nestedList_ <- list(
#' Group1 = list(a = tibble(x = 1:2), b = tibble(y = 3:4)),
#' Group2 = list(a = tibble(x = 5:6), b = tibble(y = 7:8))
#' )
#'
#' groupedData_ <- .groupByServices(datasets = nestedList_)
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/handleHTTPErrors.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#' @importFrom checkmate assert_class
#' @importFrom httr2 resp_status resp_body_json
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' response_ <- req_perform(request("https://example.org/"))
#'
#' .handleHTTPErrors(response = response_)
#'
#' @keywords internal
#' @noRd
Expand Down
10 changes: 0 additions & 10 deletions R/mergeBatch.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
#' parent list names.
#'
#' @importFrom checkmate assert_list assert_string
#'
#' @examplesIf FALSE
#' nestedList_ <- list(
#' Group1 = list(a = data.frame(x = 1:2), b = data.frame(y = 3:4)),
#' Group2 = list(a = data.frame(x = 5:6), b = data.frame(y = 7:8))
#' )
#'
#' mergedData_ <- .mergeBatch(
#' datasets = nestedList_,
#' parentColumnName = "group")
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/parseResponse.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
#' @importFrom jsonlite fromJSON
#' @importFrom httr2 resp_body_string
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' response_ <- req_perform(request("https://example.org/"))
#'
#' responseData_ <- .parseResponse(response = response_)
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/performRequest.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
#' @importFrom httr2 req_perform
#' @importFrom cli cli_abort
#'
#' @examplesIf FALSE
#' request_ <- request("https://example.org/")
#'
#' response_ <- .performRequest(request = request_)
#'
#' @keywords internal
#' @noRd
#'
Expand Down
7 changes: 0 additions & 7 deletions R/query.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@
#' connection issue triggers an informative error.
#'
#' @importFrom checkmate assert_string assert_list
#'
#' @examplesIf FALSE
#' # Get basic information about Bemisia tabaci.
#' data_ <- .query(endpoint = "/taxon/BEMITA", apiKey = "YOUR_API_KEY")
#'
#' # Get all names about Aphis pomi.
#' data_ <- .query(endpoint = "/taxon/APHIPO/names", apiKey = "YOUR_API_KEY")
#'
#' @keywords internal
#' @noRd
Expand Down
13 changes: 0 additions & 13 deletions R/rebuildReferences.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@
#' The purpose of this function is to harmonize the structure of the various
#' Reference endpoints, ensuring that the final output from `references()` is
#' consistently formatted and ready for use.
#'
#' @examplesIf FALSE
#' # ...
#' referencesData_ <- map(services, ~ .fetchService(
#' basePath = "/references",
#' apiKey = apiKey,
#' service = .x)) |>
#' set_names(services)
#'
#' # Rebuild data extracted from the Reference endpoint.
#' rebuiltReferencesData_ <- .rebuildReferences(
#' referencesData = referencesData_)
#' # ...
#'
#' @keywords internal
#' @noRd
Expand Down
5 changes: 0 additions & 5 deletions R/rebuildTaxons.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#' exclusively on that element. It extracts the `queried_on` and `queried_url`
#' fields from the raw response, replaces the `data` element with the actual
#' content, and then converts it into a tibble using `.valuesToTibbles()`.
#'
#' @examplesIf FALSE
#' taxonsData_ <- taxons()
#'
#' rebuiltTaxonData_ <- .rebuildTaxons(taxonsData = taxonsData_)
#'
#' @keywords internal
#' @noRd
Expand Down
4 changes: 3 additions & 1 deletion R/references.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#' @importFrom checkmate assert_vector assert_string
#' @importFrom purrr map set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get all information.
#' referencesData_ <- references()
#'
Expand All @@ -33,6 +34,7 @@
#'
#' # Get information about EPPO list codes and labels and countries.
#' referencesData_ <- references(services = c("qList", "countries"))
#' }
#'
#' @export
#'
Expand Down
15 changes: 6 additions & 9 deletions R/reportingService.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
#' @importFrom checkmate assert_vector assert_list assert_string assert
#' @importFrom purrr map2 set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get the list of reporting service issues.
#' reportingServiceData_ <- reportingService(
#' services = c("list"),
Expand All @@ -55,14 +56,10 @@
#' reportingServiceData_ <- reportingService(
#' services = c("reporting", "article"),
#' params = list(
#' reporting = list(
#' reporting_id = 10
#' ),
#' article = list(
#' article_id = 234
#' )
#' )
#' )
#' reporting = list(reporting_id = 10),
#' article = list(article_id = 234)
#' ))
#' }
#'
#' @export
#'
Expand Down
8 changes: 0 additions & 8 deletions R/reshapeCountriesStates.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
#' @importFrom checkmate assert_list
#' @importFrom dplyr mutate relocate bind_rows
#' @importFrom purrr imap
#'
#' @examplesIf FALSE
#' # rebuildReferences.R.
#' # ...
#' if (.y == "countriesStates") {
#' .reshapeCountriesStates(countriesStatesData = .x)
#' }
#' # ...
#'
#' @keywords internal
#' @noRd
Expand Down
4 changes: 3 additions & 1 deletion R/rppo.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#' @importFrom checkmate assert_vector assert_string
#' @importFrom purrr map set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get all information about the European and Mediterranean Plant Protection
#' # Organisation.
#' rppoData_ <- rppo(rppoCodes = c("9A"))
Expand All @@ -40,6 +41,7 @@
#' # Get basic data about European and Mediterranean Plant Protection
#' # Organisation and the European Union.
#' rppoData_ <- rppo(rppoCodes = c("9A", "9L"), services = c("overview"))
#' }
#'
#' @export
#'
Expand Down
4 changes: 3 additions & 1 deletion R/taxon.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#' @importFrom checkmate assert_vector assert_string
#' @importFrom purrr map set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get all information about Bemisia tabaci.
#' taxonData_ <- taxon(eppoCodes = c("BEMITA"))
#'
Expand All @@ -49,6 +50,7 @@
#' taxonData_ <- taxon(
#' eppoCodes = c("BEMITA", "GOSHI"),
#' services = c("taxonomy", "categorization"))
#' }
#'
#' @export
#'
Expand Down
8 changes: 4 additions & 4 deletions R/taxons.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#' @importFrom checkmate assert_vector assert_list assert_string assert
#' @importFrom purrr map2 set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get the list of taxons.
#' taxonsData_ <- taxons()
#'
Expand All @@ -40,9 +41,8 @@
#' limit = 5,
#' offset = 1,
#' orderAsc = FALSE,
#' orderBy = "eppocode"
#' )
#' ))
#' orderBy = "eppocode")))
#' }
#'
#' @export
#'
Expand Down
8 changes: 4 additions & 4 deletions R/tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
#' @importFrom checkmate assert_vector assert_list assert_string assert
#' @importFrom purrr map2 set_names
#'
#' @examplesIf FALSE
#' @examples
#' \dontrun{
#' # Get the EPPO codes associated to the name Bemisia tabaci.
#' toolsData_ <- tools(params = list(
#' name2codes = list(
#' onlyPreferred = FALSE,
#' name = "Bemisia tabaci"
#' )
#' ))
#' name = "Bemisia tabaci")))
#' }
#'
#' @export
#'
Expand Down
Loading
Loading