From f86ce64913cf9616dd014cb0fc849af7e05d1011 Mon Sep 17 00:00:00 2001 From: Dorchies David Date: Mon, 13 Feb 2023 10:10:53 +0100 Subject: [PATCH] test: add running example for select_non_nested Refs #7 --- R/utils.R | 10 +++++++++- man/utils.Rd | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index 57b8d4b..9a2839a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -9,7 +9,15 @@ #' #' @examples #' \dontrun{ -#' my_flat_list <- select_non_nested(my_nested_list) +#' l <- doApiQuery(api = "hydrobio", +#' endpoint = "stations_hydrobio", +#' params = list(code_region = 52)) +#' +#' select_non_nested(l) %>% +#' select(-code_commune, +#' -libelle_departement, +#' -(libelle_region:longitude)) %>% +#' distinct() #' } select_non_nested <- function(my_list) diff --git a/man/utils.Rd b/man/utils.Rd index bd87282..192d790 100644 --- a/man/utils.Rd +++ b/man/utils.Rd @@ -17,6 +17,14 @@ Selected the non-list elements in a nested list } \examples{ \dontrun{ -my_flat_list <- select_non_nested(my_nested_list) +l <- doApiQuery(api = "hydrobio", + endpoint = "stations_hydrobio", + params = list(code_region = 52)) + +select_non_nested(l) \%>\% + select(-code_commune, + -libelle_departement, + -(libelle_region:longitude)) \%>\% + distinct() } }