From 367e821f464a739efc47b9d9a43e71a04cb2e640 Mon Sep 17 00:00:00 2001 From: David Dorchies <14124454+DDorch@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:25:44 +0100 Subject: [PATCH 1/2] feat(poisson): add new endpoints Refs #40 --- NAMESPACE | 3 +++ R/get_poisson.R | 51 ++++++++++++++++++++++++++++++++++++++++++--- R/sysdata.rda | Bin 2910 -> 3401 bytes man/get_poisson.Rd | 26 ++++++++++++++++++++--- 4 files changed, 74 insertions(+), 6 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 7ff6e6f..606a121 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/get_poisson.R b/R/get_poisson.R index fcc3759..5cc7694 100644 --- a/R/get_poisson.R +++ b/R/get_poisson.R @@ -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( @@ -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) +} + diff --git a/R/sysdata.rda b/R/sysdata.rda index caaf2be77d8b0b6df9ec1d594b2a94d611058881..2fda8e94f86da64ae8cede3a8a0a0f012957a855 100644 GIT binary patch literal 3401 zcmV-P4Yu+^T4*^jL0KkKS?v%8762B{|A7Dh|NsB9{17ZK5JbQC|L_0-;1b^Ojcy0f z3%z^2R5b2g+q=E*WcNH9vu$-v<_}iELp^($D!TQO?;Lh+>}l!3NT#DSQ&IY9sU9^l zdXV)zr>N7@D99Qb0ks->hJYj@1cZSTO#?&J^#)BE00000GzT!613+leglI7uVr0b7 zVHyTNGGHM|A_7m+hK(MRMvVZ_0gyBUKp26bi4`?GhMK06V5jOsO{98(`lC-s8X6i6 z0Q7;N6%>Go(?Crr`e;m)_oNirCiI{&88iT7$P}Dtk8nYP4s?`}j}~f*R23V;0HFkk zR5LLENF_*w5dL@m6W^3gf8URdLr|d=y3Y^oclI?`iaZebIX_)995^VniUlIX07N4a zQc?{mO$gAS zi<0ire-$aa{i=(F-Ck-R)D3C^1HLK&H(+@cJ5-Lx#h1GVbMC< zHsnC`JGh*_wqft~s@wHHH?{D6Tjqnwws|w7;jpsPY>;U1TrIKKVhycwqhS0#cgc%> zI3ARahvPjw{C3DTi1=7w~~tX!H&0hRb^Y?*SAysZXSb>*ujGuw9s_= zSABfC>EybsB-ohji5n?WB^KLpRV&sE3f}J-#|u0@vw&>glQCiD#|NI9n(S^OFT*#U zO+FI?cF#9a>UYi5wB=^INqWX}F9RCOcLK(rZC04{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CF)4U62Vfel)Yj*zn{mOey%B=ZfptGt-BL3w}U}2wkmn%%t^h7 zs8URM{GG|yI;4wOXA*Z;C69ZW6QgOnlM-@zBE!X~O{zoUsg^9UQw&G{!gU&Q>_T#G zOjP08Uf7+k_`e8|$--|@Vb=`jqSDfYy5i(mXwo+1)Q=D(mjRRU`n)}!n(%woZ%Ypp zdnEJ3J Date: Thu, 22 Feb 2024 14:35:17 +0100 Subject: [PATCH 2/2] docs(README): add new endpoints for API Poisson Refs #40 --- README.md | 9 ++++++++- man-roxygen/hubeau.md | 5 ++++- man/hubeau.Rd | 5 ++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 56b513b..b631573 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,15 @@ API documentation: Available function: +- [`get_poisson_operations`](https://inrae.github.io/hubeau/reference/get_poisson.html): + sampling operations carried out at stations measuring the quality of + rivers - [`get_poisson_observations`](https://inrae.github.io/hubeau/reference/get_poisson.html): - scientific fishery observations + fish observations made during sampling operations +- [`get_poisson_indicateurs`](https://inrae.github.io/hubeau/reference/get_poisson.html): + the IPR and IPR+ indicators calculated from fish observations +- [`get_poisson_stations`](https://inrae.github.io/hubeau/reference/get_poisson.html): + stations measuring the quality of rivers ## API “Prélèvements en eau” diff --git a/man-roxygen/hubeau.md b/man-roxygen/hubeau.md index 426223d..1e0ea04 100644 --- a/man-roxygen/hubeau.md +++ b/man-roxygen/hubeau.md @@ -50,7 +50,10 @@ API documentation: Available function: -- [get_poisson_observations()]: scientific fishery observations +- [get_poisson_operations()]: sampling operations carried out at stations measuring the quality of rivers +- [get_poisson_observations()]: fish observations made during sampling operations +- [get_poisson_indicateurs()]: the IPR and IPR+ indicators calculated from fish observations +- [get_poisson_stations()]: stations measuring the quality of rivers ## API "Prélèvements en eau" diff --git a/man/hubeau.Rd b/man/hubeau.Rd index c2d3ad1..59799cd 100644 --- a/man/hubeau.Rd +++ b/man/hubeau.Rd @@ -63,7 +63,10 @@ API documentation: \url{https://hubeau.eaufrance.fr/page/api-poisson} Available function: \itemize{ -\item \code{\link[=get_poisson_observations]{get_poisson_observations()}}: scientific fishery observations +\item \code{\link[=get_poisson_operations]{get_poisson_operations()}}: sampling operations carried out at stations measuring the quality of rivers +\item \code{\link[=get_poisson_observations]{get_poisson_observations()}}: fish observations made during sampling operations +\item \code{\link[=get_poisson_indicateurs]{get_poisson_indicateurs()}}: the IPR and IPR+ indicators calculated from fish observations +\item \code{\link[=get_poisson_stations]{get_poisson_stations()}}: stations measuring the quality of rivers } }