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 caaf2be..2fda8e9 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ 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/get_poisson.Rd b/man/get_poisson.Rd index 1a286e0..776f08a 100644 --- a/man/get_poisson.Rd +++ b/man/get_poisson.Rd @@ -2,9 +2,18 @@ % Please edit documentation in R/get_poisson.R \name{get_poisson_observations} \alias{get_poisson_observations} +\alias{get_poisson_indicateurs} +\alias{get_poisson_operations} +\alias{get_poisson_stations} \title{Retrieve data from API "Poisson"} \usage{ get_poisson_observations(...) + +get_poisson_indicateurs(...) + +get_poisson_operations(...) + +get_poisson_stations(...) } \arguments{ \item{...}{parameters of the queries and their values in the format @@ -25,18 +34,29 @@ See the API documentation for available filter parameters: \url{https://hubeau.e } \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( 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 } }