get_hydrometrie_sites.Rd 1.70 KiB
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_hydrometrie_sites.R
\name{get_hydrometrie_sites}
\alias{get_hydrometrie_sites}
\title{Retrieve hydrometric sites from API "Hydrométrie"}
\usage{
get_hydrometrie_sites(
  params,
  unique_site = TRUE,
  cfg = config::get(file = system.file("config.yml", package = "hubeau"))
\arguments{
\item{params}{a \link{list} the list of parameters of the queries and their values in the format \code{list(ParamName = "Param value", ...)}, use the function \link{get_available_params} for a list of the available parameters for a given operation in an API and see the API documentation for the complete list of available filter parameters}
\item{unique_site}{optional \link{logical}, if set to \code{FALSE} sites with several different locations produce one row by different location otherwise the first location found is used for fields \code{code_commune_site}, \code{libelle_commune}, \code{code_departement}, \code{code_region}, \code{libelle_region}, \code{libelle_departement}}
\item{cfg}{a \link{config} object Configuration of the communication. Use by default the internal package
configuration}
\value{
a \link[tibble:tibble]{tibble::tibble} with all available parameters in columns and one row by device, year and usage.
\description{
See the API documentation for available filter parameters: \url{https://hubeau.eaufrance.fr/page/api-hydrometrie}
\examples{
# For retrieving the hydrometric sites in the department of Aube
get_hydrometrie_sites(list(code_departement = "10"))
# The same operation returning 2 rows for the site 'H0203020' which has 2 different locations
get_hydrometrie_sites(list(code_departement = "10"), unique_site = FALSE)