Skip to content

Commit

Permalink
feat(poisson): add new endpoints
Browse files Browse the repository at this point in the history
Refs #40
  • Loading branch information
DDorch committed Feb 22, 2024
1 parent f7555b9 commit 367e821
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 6 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export(get_indicateurs_services_services)
export(get_niveaux_nappes_chroniques)
export(get_niveaux_nappes_chroniques_tr)
export(get_niveaux_nappes_stations)
export(get_poisson_indicateurs)
export(get_poisson_observations)
export(get_poisson_operations)
export(get_poisson_stations)
export(get_prelevements_chroniques)
export(get_prelevements_ouvrages)
export(get_prelevements_points_prelevement)
Expand Down
51 changes: 48 additions & 3 deletions R/get_poisson.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,29 @@
#'
#' @examples
#' \dontrun{
#' # Get the endpoints available for the API "Poisson"
#' list_endpoints(api = "poisson")
#'
#' # List the stations available in Brest
#' get_poisson_stations(libelle_commune = "Brest")
#'
#' # List the operations available in Brest
#' get_poisson_operations(libelle_commune = "Brest")
#'
#' # List the indicators available in Brest
#' get_poisson_indicateurs(libelle_commune = "Brest")
#'
#' # Get the query parameters for the requested API/endpoint
#' list_params(api = "poisson",
#' endpoint = "observations")
#'
#' # Retrieve selected fields on a river fish sampled in Brest
#' library(dplyr)
#' fields <- paste("code_operation",
#' fields <- c("code_operation",
#' "date_operation",
#' "libelle_point_prelevement_aspe",
#' "effectif_lot",
#' "code_alternatif_taxon",
#' sep = ",")
#' "code_alternatif_taxon")
#'
#' brest_fishes <- get_poisson_observations(
#' list(
Expand All @@ -47,3 +58,37 @@ get_poisson_observations <- function(...) {

convert_list_to_tibble(l)
}

#' @export
#' @rdname get_poisson
get_poisson_indicateurs <- function(...) {

l <- doApiQuery(api = "poisson",
endpoint = "indicateurs",
...)

convert_list_to_tibble(l)
}

#' @export
#' @rdname get_poisson
get_poisson_operations <- function(...) {

l <- doApiQuery(api = "poisson",
endpoint = "operations",
...)

convert_list_to_tibble(l)
}

#' @export
#' @rdname get_poisson
get_poisson_stations <- function(...) {

l <- doApiQuery(api = "poisson",
endpoint = "stations",
...)

convert_list_to_tibble(l)
}

Binary file modified R/sysdata.rda
Binary file not shown.
26 changes: 23 additions & 3 deletions man/get_poisson.Rd

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

0 comments on commit 367e821

Please sign in to comment.