From 439307f3de83adaf6c768b9440f72c071fef8e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 5 Nov 2024 15:31:55 +0100 Subject: [PATCH 01/10] docs: better documentation for wfs argument --- R/info.R | 2 +- man/emodnet_get_layers.Rd | 2 +- man/emodnet_get_wfs_info.Rd | 2 +- man/layer_attribute_descriptions.Rd | 2 +- man/layer_attribute_inspect.Rd | 2 +- man/layer_attributes_get_names.Rd | 2 +- man/layer_attributes_summarise.Rd | 2 +- man/layer_attributes_tbl.Rd | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/info.R b/R/info.R index 270c8ee..2c42920 100644 --- a/R/info.R +++ b/R/info.R @@ -79,7 +79,7 @@ emodnet_get_layer_info <- memoise::memoise(.emodnet_get_layer_info) #' Get WFS available layer information #' #' @param wfs A `WFSClient` R6 object with methods for interfacing an -#' OGC Web Feature Service. +#' OGC Web Feature Service. From [`emodnet_init_wfs_client()`]. #' @inheritParams emodnet_init_wfs_client #' @return a tibble containing metadata on each layer available from the #' service. diff --git a/man/emodnet_get_layers.Rd b/man/emodnet_get_layers.Rd index f7841ce..218cf82 100644 --- a/man/emodnet_get_layers.Rd +++ b/man/emodnet_get_layers.Rd @@ -17,7 +17,7 @@ emodnet_get_layers( } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{service}{the EMODnet OGC WFS service name. For available services, see \code{\link[=emodnet_wfs]{emodnet_wfs()}}.} diff --git a/man/emodnet_get_wfs_info.Rd b/man/emodnet_get_wfs_info.Rd index 2efdd75..fd44a2f 100644 --- a/man/emodnet_get_wfs_info.Rd +++ b/man/emodnet_get_wfs_info.Rd @@ -14,7 +14,7 @@ emodnet_get_all_wfs_info() } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{layers}{a character vector of layer names. To get info on layers, including diff --git a/man/layer_attribute_descriptions.Rd b/man/layer_attribute_descriptions.Rd index 4634c68..b3cc5bd 100644 --- a/man/layer_attribute_descriptions.Rd +++ b/man/layer_attribute_descriptions.Rd @@ -13,7 +13,7 @@ layer_attribute_descriptions( } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{service}{the EMODnet OGC WFS service name. For available services, see \code{\link[=emodnet_wfs]{emodnet_wfs()}}.} diff --git a/man/layer_attribute_inspect.Rd b/man/layer_attribute_inspect.Rd index 31f7b6d..a62d2a2 100644 --- a/man/layer_attribute_inspect.Rd +++ b/man/layer_attribute_inspect.Rd @@ -14,7 +14,7 @@ layer_attribute_inspect( } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{service}{the EMODnet OGC WFS service name. For available services, see \code{\link[=emodnet_wfs]{emodnet_wfs()}}.} diff --git a/man/layer_attributes_get_names.Rd b/man/layer_attributes_get_names.Rd index 84819c5..d136b72 100644 --- a/man/layer_attributes_get_names.Rd +++ b/man/layer_attributes_get_names.Rd @@ -13,7 +13,7 @@ layer_attributes_get_names( } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{service}{the EMODnet OGC WFS service name. For available services, see \code{\link[=emodnet_wfs]{emodnet_wfs()}}.} diff --git a/man/layer_attributes_summarise.Rd b/man/layer_attributes_summarise.Rd index e05085a..3dffeaf 100644 --- a/man/layer_attributes_summarise.Rd +++ b/man/layer_attributes_summarise.Rd @@ -13,7 +13,7 @@ layer_attributes_summarise( } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{service}{the EMODnet OGC WFS service name. For available services, see \code{\link[=emodnet_wfs]{emodnet_wfs()}}.} diff --git a/man/layer_attributes_tbl.Rd b/man/layer_attributes_tbl.Rd index b456d0b..7981911 100644 --- a/man/layer_attributes_tbl.Rd +++ b/man/layer_attributes_tbl.Rd @@ -8,7 +8,7 @@ layer_attributes_tbl(wfs = NULL, service = NULL, service_version = NULL, layer) } \arguments{ \item{wfs}{A \code{WFSClient} R6 object with methods for interfacing an -OGC Web Feature Service.} +OGC Web Feature Service. From \code{\link[=emodnet_init_wfs_client]{emodnet_init_wfs_client()}}.} \item{service}{the EMODnet OGC WFS service name. For available services, see \code{\link[=emodnet_wfs]{emodnet_wfs()}}.} From d6b3d98976a37766be2a0d8bf287c764ef06c19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 5 Nov 2024 15:34:28 +0100 Subject: [PATCH 02/10] docs: description for `emodnet_get_layer_info()` and friends --- R/info.R | 5 +++++ man/emodnet_get_wfs_info.Rd | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/R/info.R b/R/info.R index 2c42920..c4a2ce3 100644 --- a/R/info.R +++ b/R/info.R @@ -78,6 +78,11 @@ emodnet_get_layer_info <- memoise::memoise(.emodnet_get_layer_info) } #' Get WFS available layer information #' +#' Metadata about data available from the different services: +#' data (layers) from a data source (service), +#' metadata on layers from a service, +#' metadata on layers from all services. +#' #' @param wfs A `WFSClient` R6 object with methods for interfacing an #' OGC Web Feature Service. From [`emodnet_init_wfs_client()`]. #' @inheritParams emodnet_init_wfs_client diff --git a/man/emodnet_get_wfs_info.Rd b/man/emodnet_get_wfs_info.Rd index fd44a2f..2c03177 100644 --- a/man/emodnet_get_wfs_info.Rd +++ b/man/emodnet_get_wfs_info.Rd @@ -31,7 +31,10 @@ a tibble containing metadata on each layer available from the service. } \description{ -Get WFS available layer information +Metadata about data available from the different services: +data (layers) from a data source (service), +metadata on layers from a service, +metadata on layers from all services. } \details{ To minimize the number of requests sent to webservices, From 9ac33073affc01ddc9e1dad349a90a29f905a3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 5 Nov 2024 15:35:55 +0100 Subject: [PATCH 03/10] docs: description and safer example for `emodnet_wfs()` --- R/emodnet_wfs.R | 4 +++- man/emodnet_wfs.Rd | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/emodnet_wfs.R b/R/emodnet_wfs.R index 6dffbc8..69c2ba2 100644 --- a/R/emodnet_wfs.R +++ b/R/emodnet_wfs.R @@ -6,9 +6,11 @@ } #' Available EMODnet Web Feature Services #' +#' Which data sources (services) are available? +#' #' @return Tibble of available EMODnet Web Feature Services #' -#' @examples +#' @examplesIf interactive() #' emodnet_wfs() #' @export emodnet_wfs <- memoise::memoise(.emodnet_wfs) diff --git a/man/emodnet_wfs.Rd b/man/emodnet_wfs.Rd index f437e6c..cdfcbac 100644 --- a/man/emodnet_wfs.Rd +++ b/man/emodnet_wfs.Rd @@ -10,8 +10,10 @@ emodnet_wfs() Tibble of available EMODnet Web Feature Services } \description{ -Available EMODnet Web Feature Services +Which data sources (services) are available? } \examples{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} emodnet_wfs() +\dontshow{\}) # examplesIf} } From e6b33a96dafd6378ca89bed7decbc16d1eeca12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 5 Nov 2024 15:37:18 +0100 Subject: [PATCH 04/10] docs: description and safer example for `layer_attribute_descriptions()` --- R/layer_attributes.R | 6 +++--- man/layer_attribute_descriptions.Rd | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/layer_attributes.R b/R/layer_attributes.R index aed0302..5ef6365 100644 --- a/R/layer_attributes.R +++ b/R/layer_attributes.R @@ -35,6 +35,8 @@ layer_attributes_summarise <- function(wfs = NULL, #' Get layer attribute description #' +#' Variables available in a dataset (layer) from a data source (service). +#' #' @inheritParams emodnet_init_wfs_client #' @inheritParams emodnet_get_wfs_info #' @inheritParams layer_attributes_summarise @@ -42,13 +44,11 @@ layer_attributes_summarise <- function(wfs = NULL, #' @return data.frame containing layer attribute descriptions (metadata). #' @export #' -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' layer_attribute_descriptions( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" #' ) -#' } layer_attribute_descriptions <- function(wfs = NULL, service = NULL, service_version = NULL, layer) { diff --git a/man/layer_attribute_descriptions.Rd b/man/layer_attribute_descriptions.Rd index b3cc5bd..6bf30a2 100644 --- a/man/layer_attribute_descriptions.Rd +++ b/man/layer_attribute_descriptions.Rd @@ -28,13 +28,13 @@ the WFS service version. Now always "2.0.0".} data.frame containing layer attribute descriptions (metadata). } \description{ -Get layer attribute description +Variables available in a dataset (layer) from a data source (service). } \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attribute_descriptions( service = "biology", layer = "mediseh_zostera_m_pnt" ) -} +\dontshow{\}) # examplesIf} } From b4ccb6450e94480a75205ec07901c26c0874a8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 5 Nov 2024 15:46:49 +0100 Subject: [PATCH 05/10] docs: description and safer example for layer_attribute_inspect() --- R/layer_attributes.R | 7 ++++--- man/layer_attribute_inspect.Rd | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/R/layer_attributes.R b/R/layer_attributes.R index 5ef6365..45d8975 100644 --- a/R/layer_attributes.R +++ b/R/layer_attributes.R @@ -98,6 +98,9 @@ layer_attributes_get_names <- function(wfs = NULL, #' Inspect layer attributes #' +#' Summary of individual variable (attribute) in a dataset (layer) from a +#' data source (service). +#' #' @inheritParams layer_attributes_summarise #' @param attribute character string, name of layer attribute (variable). Use #' [layer_attributes_get_names()] to get layer attribute names. @@ -109,15 +112,13 @@ layer_attributes_get_names <- function(wfs = NULL, #' factor or character variable levels or unique values. #' @export #' -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' wfs <- emodnet_init_wfs_client(service = "biology") #' layer_attributes_get_names(wfs, layer = "mediseh_zostera_m_pnt") #' layer_attribute_inspect( #' wfs, layer = "mediseh_zostera_m_pnt", #' attribute = "country" #' ) -#' } layer_attribute_inspect <- function(wfs = NULL, service = NULL, service_version = NULL, diff --git a/man/layer_attribute_inspect.Rd b/man/layer_attribute_inspect.Rd index a62d2a2..6197714 100644 --- a/man/layer_attribute_inspect.Rd +++ b/man/layer_attribute_inspect.Rd @@ -34,15 +34,16 @@ useful for inspecting factor or character variable levels or unique values. } \description{ -Inspect layer attributes +Summary of individual variable (attribute) in a dataset (layer) from a +data source (service). } \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} wfs <- emodnet_init_wfs_client(service = "biology") layer_attributes_get_names(wfs, layer = "mediseh_zostera_m_pnt") layer_attribute_inspect( wfs, layer = "mediseh_zostera_m_pnt", attribute = "country" ) -} +\dontshow{\}) # examplesIf} } From 2da24f8089380f04c377b2254081adcf58ae59a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Tue, 5 Nov 2024 16:00:16 +0100 Subject: [PATCH 06/10] docs: better manual pages for attributes related functions --- R/layer_attributes.R | 24 ++++++++++++++---------- man/layer_attribute_descriptions.Rd | 8 ++++++++ man/layer_attribute_inspect.Rd | 8 ++++++++ man/layer_attributes_get_names.Rd | 16 +++++++++++++--- man/layer_attributes_summarise.Rd | 10 +++++++++- man/layer_attributes_tbl.Rd | 13 +++++++++++-- man/roxygen/meta.R | 5 +++++ 7 files changed, 68 insertions(+), 16 deletions(-) create mode 100644 man/roxygen/meta.R diff --git a/R/layer_attributes.R b/R/layer_attributes.R index 45d8975..13973ee 100644 --- a/R/layer_attributes.R +++ b/R/layer_attributes.R @@ -7,15 +7,14 @@ #' #' @return output of `summary()` on the attributes (variables) in a given layer #' for a given service. +#' @family attributes #' @export #' -#' @examples -#' \dontrun{ +#' @examplesIf interactive #' layer_attributes_summarise( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" #' ) -#' } layer_attributes_summarise <- function(wfs = NULL, service = NULL, service_version = NULL, @@ -42,6 +41,7 @@ layer_attributes_summarise <- function(wfs = NULL, #' @inheritParams layer_attributes_summarise #' #' @return data.frame containing layer attribute descriptions (metadata). +#' @family attributes #' @export #' #' @examplesIf interactive() @@ -64,22 +64,23 @@ layer_attribute_descriptions <- function(wfs = NULL, } -#' Get names of layer attributes +#' Names of variables (attributes) available from a dataset (layer) +#' in a data source (service). #' #' @inheritParams emodnet_init_wfs_client #' @inheritParams emodnet_get_wfs_info #' @inheritParams layer_attributes_summarise #' +#' @family attributes +#' #' @return character vector of layer attribute (variable) names. #' @export #' -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' layer_attributes_get_names( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" #' ) -#' } layer_attributes_get_names <- function(wfs = NULL, service = NULL, service_version = NULL, @@ -110,6 +111,7 @@ layer_attributes_get_names <- function(wfs = NULL, #' @return Detailed summary of individual attribute (variable). Particularly #' useful for inspecting #' factor or character variable levels or unique values. +#' @family attributes #' @export #' #' @examplesIf interactive() @@ -164,6 +166,9 @@ layer_attribute_inspect <- function(wfs = NULL, #' Get layer attribute values tibble #' +#' Possible values of variables (attributes) in a dataset (layer) +#' from a data source (service). +#' #' @inheritParams emodnet_init_wfs_client #' @inheritParams emodnet_get_wfs_info #' @inheritParams layer_attributes_summarise @@ -175,12 +180,11 @@ layer_attribute_inspect <- function(wfs = NULL, #' useful for inspecting attribute values and constructing feature filters #' for more #' targeted and faster layer download. +#' @family attributes #' @export #' -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' layer_attributes_tbl(service = "biology", layer = "mediseh_zostera_m_pnt") -#' } layer_attributes_tbl <- function(wfs = NULL, service = NULL, service_version = NULL, layer) { diff --git a/man/layer_attribute_descriptions.Rd b/man/layer_attribute_descriptions.Rd index 6bf30a2..0ce6396 100644 --- a/man/layer_attribute_descriptions.Rd +++ b/man/layer_attribute_descriptions.Rd @@ -38,3 +38,11 @@ layer_attribute_descriptions( ) \dontshow{\}) # examplesIf} } +\seealso{ +Attributes metadata: +\code{\link{layer_attribute_inspect}()}, +\code{\link{layer_attributes_get_names}()}, +\code{\link{layer_attributes_summarise}()}, +\code{\link{layer_attributes_tbl}()} +} +\concept{attributes} diff --git a/man/layer_attribute_inspect.Rd b/man/layer_attribute_inspect.Rd index 6197714..eb6e7db 100644 --- a/man/layer_attribute_inspect.Rd +++ b/man/layer_attribute_inspect.Rd @@ -47,3 +47,11 @@ layer_attribute_inspect( ) \dontshow{\}) # examplesIf} } +\seealso{ +Attributes metadata: +\code{\link{layer_attribute_descriptions}()}, +\code{\link{layer_attributes_get_names}()}, +\code{\link{layer_attributes_summarise}()}, +\code{\link{layer_attributes_tbl}()} +} +\concept{attributes} diff --git a/man/layer_attributes_get_names.Rd b/man/layer_attributes_get_names.Rd index d136b72..5ee0f35 100644 --- a/man/layer_attributes_get_names.Rd +++ b/man/layer_attributes_get_names.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/layer_attributes.R \name{layer_attributes_get_names} \alias{layer_attributes_get_names} -\title{Get names of layer attributes} +\title{Names of variables (attributes) available from a dataset (layer) +in a data source (service).} \usage{ layer_attributes_get_names( wfs = NULL, @@ -28,13 +29,22 @@ the WFS service version. Now always "2.0.0".} character vector of layer attribute (variable) names. } \description{ -Get names of layer attributes +Names of variables (attributes) available from a dataset (layer) +in a data source (service). } \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_get_names( service = "biology", layer = "mediseh_zostera_m_pnt" ) +\dontshow{\}) # examplesIf} } +\seealso{ +Attributes metadata: +\code{\link{layer_attribute_descriptions}()}, +\code{\link{layer_attribute_inspect}()}, +\code{\link{layer_attributes_summarise}()}, +\code{\link{layer_attributes_tbl}()} } +\concept{attributes} diff --git a/man/layer_attributes_summarise.Rd b/man/layer_attributes_summarise.Rd index 3dffeaf..65be4e6 100644 --- a/man/layer_attributes_summarise.Rd +++ b/man/layer_attributes_summarise.Rd @@ -32,10 +32,18 @@ for a given service. Get summaries of layer attributes (variables) } \examples{ -\dontrun{ +\dontshow{if (interactive) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_summarise( service = "biology", layer = "mediseh_zostera_m_pnt" ) +\dontshow{\}) # examplesIf} } +\seealso{ +Attributes metadata: +\code{\link{layer_attribute_descriptions}()}, +\code{\link{layer_attribute_inspect}()}, +\code{\link{layer_attributes_get_names}()}, +\code{\link{layer_attributes_tbl}()} } +\concept{attributes} diff --git a/man/layer_attributes_tbl.Rd b/man/layer_attributes_tbl.Rd index 7981911..600518a 100644 --- a/man/layer_attributes_tbl.Rd +++ b/man/layer_attributes_tbl.Rd @@ -24,7 +24,8 @@ tibble of layer attribute (variable) values with geometry column removed. } \description{ -Get layer attribute values tibble +Possible values of variables (attributes) in a dataset (layer) +from a data source (service). } \details{ Request excluding spatial information can be significantly faster. @@ -34,7 +35,15 @@ for more targeted and faster layer download. } \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_tbl(service = "biology", layer = "mediseh_zostera_m_pnt") +\dontshow{\}) # examplesIf} } +\seealso{ +Attributes metadata: +\code{\link{layer_attribute_descriptions}()}, +\code{\link{layer_attribute_inspect}()}, +\code{\link{layer_attributes_get_names}()}, +\code{\link{layer_attributes_summarise}()} } +\concept{attributes} diff --git a/man/roxygen/meta.R b/man/roxygen/meta.R new file mode 100644 index 0000000..b471dbd --- /dev/null +++ b/man/roxygen/meta.R @@ -0,0 +1,5 @@ +list( + rd_family_title = list( + attributes = "Attributes metadata:" + ) +) From d8522cdb64510d08683232971f91437a5e1bc459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 7 Nov 2024 13:29:55 +0100 Subject: [PATCH 07/10] docs: description and safer example for `emodnet_init_wfs_client()` --- R/client.R | 6 +++--- man/emodnet_init_wfs_client.Rd | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/client.R b/R/client.R index ee52082..11f43c5 100644 --- a/R/client.R +++ b/R/client.R @@ -1,5 +1,7 @@ #' Initialise an EMODnet WFS client #' +#' Connect to a data source (service) +#' #' @param service the EMODnet OGC WFS service name. #' For available services, see [`emodnet_wfs()`]. #' @param service_version `r lifecycle::badge('deprecated')` @@ -13,10 +15,8 @@ #' @export #' #' @seealso `WFSClient` in package `ows4R`. -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' wfs <- emodnet_init_wfs_client(service = "bathymetry") -#' } emodnet_init_wfs_client <- function(service, service_version = NULL, logger = NULL) { diff --git a/man/emodnet_init_wfs_client.Rd b/man/emodnet_init_wfs_client.Rd index b2c4696..6413b2f 100644 --- a/man/emodnet_init_wfs_client.Rd +++ b/man/emodnet_init_wfs_client.Rd @@ -22,12 +22,12 @@ An \code{\link[ows4R:WFSClient]{ows4R::WFSClient}} R6 object with methods for in OGC Web Feature Service. } \description{ -Initialise an EMODnet WFS client +Connect to a data source (service) } \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} wfs <- emodnet_init_wfs_client(service = "bathymetry") -} +\dontshow{\}) # examplesIf} } \seealso{ \code{WFSClient} in package \code{ows4R}. From 5ae594a2eeae26c3a8d4ec8cf72b570cf5485212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 7 Nov 2024 13:30:44 +0100 Subject: [PATCH 08/10] docs: safer example for `emodnet_get_wfs_info()` --- R/info.R | 4 +--- man/emodnet_get_wfs_info.Rd | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/R/info.R b/R/info.R index c4a2ce3..8ac0e12 100644 --- a/R/info.R +++ b/R/info.R @@ -91,8 +91,7 @@ emodnet_get_layer_info <- memoise::memoise(.emodnet_get_layer_info) #' @export #' @describeIn emodnet_get_wfs_info Get info on all layers from #' an EMODnet WFS service. -#' @examples -#' \dontrun{ +#' @examplesIf interactive() #' emodnet_get_wfs_info(service = "bathymetry") #' # Query a wfs object #' wfs_bio <- emodnet_init_wfs_client("biology") @@ -100,7 +99,6 @@ emodnet_get_layer_info <- memoise::memoise(.emodnet_get_layer_info) #' # Get info for specific layers from wfs object #' layers <- c("mediseh_zostera_m_pnt", "mediseh_posidonia_nodata") #' emodnet_get_layer_info(wfs = wfs_bio, layers = layers) -#' } emodnet_get_wfs_info <- memoise::memoise(.emodnet_get_wfs_info) #' @describeIn emodnet_get_wfs_info Get metadata on all layers and all available diff --git a/man/emodnet_get_wfs_info.Rd b/man/emodnet_get_wfs_info.Rd index 2c03177..dee55f7 100644 --- a/man/emodnet_get_wfs_info.Rd +++ b/man/emodnet_get_wfs_info.Rd @@ -56,7 +56,7 @@ services from server. }} \examples{ -\dontrun{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} emodnet_get_wfs_info(service = "bathymetry") # Query a wfs object wfs_bio <- emodnet_init_wfs_client("biology") @@ -64,5 +64,5 @@ emodnet_get_wfs_info(wfs_bio) # Get info for specific layers from wfs object layers <- c("mediseh_zostera_m_pnt", "mediseh_posidonia_nodata") emodnet_get_layer_info(wfs = wfs_bio, layers = layers) -} +\dontshow{\}) # examplesIf} } From 64e7ef6d31dca8e0e9626d15881dd26231cc5562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 7 Nov 2024 13:52:20 +0100 Subject: [PATCH 09/10] fix docs --- R/layer_attributes.R | 2 +- man/layer_attributes_summarise.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/layer_attributes.R b/R/layer_attributes.R index 13973ee..40af00a 100644 --- a/R/layer_attributes.R +++ b/R/layer_attributes.R @@ -10,7 +10,7 @@ #' @family attributes #' @export #' -#' @examplesIf interactive +#' @examplesIf interactive() #' layer_attributes_summarise( #' service = "biology", #' layer = "mediseh_zostera_m_pnt" diff --git a/man/layer_attributes_summarise.Rd b/man/layer_attributes_summarise.Rd index 65be4e6..fc73e41 100644 --- a/man/layer_attributes_summarise.Rd +++ b/man/layer_attributes_summarise.Rd @@ -32,7 +32,7 @@ for a given service. Get summaries of layer attributes (variables) } \examples{ -\dontshow{if (interactive) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} layer_attributes_summarise( service = "biology", layer = "mediseh_zostera_m_pnt" From 27a9ee67cd47de19786b70ae066f0aec63c44643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Thu, 7 Nov 2024 14:12:20 +0100 Subject: [PATCH 10/10] docs: for a better pkgdown ref index --- R/client.R | 4 ++-- R/emodnet_wfs.R | 4 ++-- R/info.R | 4 ++-- R/layer_attributes.R | 12 ++++++------ R/layers.R | 2 +- man/emodnet_get_layers.Rd | 2 +- man/emodnet_get_wfs_info.Rd | 10 +++++----- man/emodnet_init_wfs_client.Rd | 4 ++-- man/emodnet_wfs.Rd | 4 ++-- man/layer_attribute_descriptions.Rd | 4 ++-- man/layer_attribute_inspect.Rd | 6 +++--- man/layer_attributes_tbl.Rd | 6 +++--- pkgdown/_pkgdown.yml | 4 ++-- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/R/client.R b/R/client.R index 11f43c5..c66006c 100644 --- a/R/client.R +++ b/R/client.R @@ -1,6 +1,6 @@ -#' Initialise an EMODnet WFS client +#' @description Initialise an EMODnet WFS client #' -#' Connect to a data source (service) +#' @title Connect to a data source (service) #' #' @param service the EMODnet OGC WFS service name. #' For available services, see [`emodnet_wfs()`]. diff --git a/R/emodnet_wfs.R b/R/emodnet_wfs.R index 69c2ba2..7c2f544 100644 --- a/R/emodnet_wfs.R +++ b/R/emodnet_wfs.R @@ -4,9 +4,9 @@ stringsAsFactors = FALSE ) } -#' Available EMODnet Web Feature Services +#' @description Available EMODnet Web Feature Services #' -#' Which data sources (services) are available? +#' @title Which data sources (services) are available? #' #' @return Tibble of available EMODnet Web Feature Services #' diff --git a/R/info.R b/R/info.R index 8ac0e12..e54abfb 100644 --- a/R/info.R +++ b/R/info.R @@ -76,9 +76,9 @@ emodnet_get_layer_info <- memoise::memoise(.emodnet_get_layer_info) layer_name = strsplit(layer_name, ":", fixed = TRUE)[[1]][2] ) } -#' Get WFS available layer information +#' @description Get WFS available layer information #' -#' Metadata about data available from the different services: +#' @title Metadata about data available from the different services: #' data (layers) from a data source (service), #' metadata on layers from a service, #' metadata on layers from all services. diff --git a/R/layer_attributes.R b/R/layer_attributes.R index 40af00a..aa72b5f 100644 --- a/R/layer_attributes.R +++ b/R/layer_attributes.R @@ -32,9 +32,9 @@ layer_attributes_summarise <- function(wfs = NULL, ) } -#' Get layer attribute description +#' @description Get layer attribute description #' -#' Variables available in a dataset (layer) from a data source (service). +#' @title Variables available in a dataset (layer) from a data source (service). #' #' @inheritParams emodnet_init_wfs_client #' @inheritParams emodnet_get_wfs_info @@ -97,9 +97,9 @@ layer_attributes_get_names <- function(wfs = NULL, )$name } -#' Inspect layer attributes +#' @description Inspect layer attributes #' -#' Summary of individual variable (attribute) in a dataset (layer) from a +#' @title Summary of individual variable (attribute) in a dataset (layer) from a #' data source (service). #' #' @inheritParams layer_attributes_summarise @@ -164,9 +164,9 @@ layer_attribute_inspect <- function(wfs = NULL, ) } -#' Get layer attribute values tibble +#' @description Get layer attribute values tibble #' -#' Possible values of variables (attributes) in a dataset (layer) +#' @title Possible values of variables (attributes) in a dataset (layer) #' from a data source (service). #' #' @inheritParams emodnet_init_wfs_client diff --git a/R/layers.R b/R/layers.R index 3adb5e4..bc4633f 100644 --- a/R/layers.R +++ b/R/layers.R @@ -1,4 +1,4 @@ -#' Get EMODnet WFS layers +#' Get EMODnet WFS datasets (layers) #' #' Performs an WFS getFeature request for layers from a `wfs` object or #' specified EMODnet Service. Filtering diff --git a/man/emodnet_get_layers.Rd b/man/emodnet_get_layers.Rd index 218cf82..0d6319c 100644 --- a/man/emodnet_get_layers.Rd +++ b/man/emodnet_get_layers.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/layers.R \name{emodnet_get_layers} \alias{emodnet_get_layers} -\title{Get EMODnet WFS layers} +\title{Get EMODnet WFS datasets (layers)} \usage{ emodnet_get_layers( wfs = NULL, diff --git a/man/emodnet_get_wfs_info.Rd b/man/emodnet_get_wfs_info.Rd index dee55f7..03d08cf 100644 --- a/man/emodnet_get_wfs_info.Rd +++ b/man/emodnet_get_wfs_info.Rd @@ -4,7 +4,10 @@ \alias{emodnet_get_layer_info} \alias{emodnet_get_wfs_info} \alias{emodnet_get_all_wfs_info} -\title{Get WFS available layer information} +\title{Metadata about data available from the different services: +data (layers) from a data source (service), +metadata on layers from a service, +metadata on layers from all services.} \usage{ emodnet_get_layer_info(wfs, layers) @@ -31,10 +34,7 @@ a tibble containing metadata on each layer available from the service. } \description{ -Metadata about data available from the different services: -data (layers) from a data source (service), -metadata on layers from a service, -metadata on layers from all services. +Get WFS available layer information } \details{ To minimize the number of requests sent to webservices, diff --git a/man/emodnet_init_wfs_client.Rd b/man/emodnet_init_wfs_client.Rd index 6413b2f..6e96241 100644 --- a/man/emodnet_init_wfs_client.Rd +++ b/man/emodnet_init_wfs_client.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/client.R \name{emodnet_init_wfs_client} \alias{emodnet_init_wfs_client} -\title{Initialise an EMODnet WFS client} +\title{Connect to a data source (service)} \usage{ emodnet_init_wfs_client(service, service_version = NULL, logger = NULL) } @@ -22,7 +22,7 @@ An \code{\link[ows4R:WFSClient]{ows4R::WFSClient}} R6 object with methods for in OGC Web Feature Service. } \description{ -Connect to a data source (service) +Initialise an EMODnet WFS client } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/emodnet_wfs.Rd b/man/emodnet_wfs.Rd index cdfcbac..0f85e1f 100644 --- a/man/emodnet_wfs.Rd +++ b/man/emodnet_wfs.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/emodnet_wfs.R \name{emodnet_wfs} \alias{emodnet_wfs} -\title{Available EMODnet Web Feature Services} +\title{Which data sources (services) are available?} \usage{ emodnet_wfs() } @@ -10,7 +10,7 @@ emodnet_wfs() Tibble of available EMODnet Web Feature Services } \description{ -Which data sources (services) are available? +Available EMODnet Web Feature Services } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/layer_attribute_descriptions.Rd b/man/layer_attribute_descriptions.Rd index 0ce6396..c7e032f 100644 --- a/man/layer_attribute_descriptions.Rd +++ b/man/layer_attribute_descriptions.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/layer_attributes.R \name{layer_attribute_descriptions} \alias{layer_attribute_descriptions} -\title{Get layer attribute description} +\title{Variables available in a dataset (layer) from a data source (service).} \usage{ layer_attribute_descriptions( wfs = NULL, @@ -28,7 +28,7 @@ the WFS service version. Now always "2.0.0".} data.frame containing layer attribute descriptions (metadata). } \description{ -Variables available in a dataset (layer) from a data source (service). +Get layer attribute description } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/layer_attribute_inspect.Rd b/man/layer_attribute_inspect.Rd index eb6e7db..2e559c5 100644 --- a/man/layer_attribute_inspect.Rd +++ b/man/layer_attribute_inspect.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/layer_attributes.R \name{layer_attribute_inspect} \alias{layer_attribute_inspect} -\title{Inspect layer attributes} +\title{Summary of individual variable (attribute) in a dataset (layer) from a +data source (service).} \usage{ layer_attribute_inspect( wfs = NULL, @@ -34,8 +35,7 @@ useful for inspecting factor or character variable levels or unique values. } \description{ -Summary of individual variable (attribute) in a dataset (layer) from a -data source (service). +Inspect layer attributes } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/layer_attributes_tbl.Rd b/man/layer_attributes_tbl.Rd index 600518a..3cd6952 100644 --- a/man/layer_attributes_tbl.Rd +++ b/man/layer_attributes_tbl.Rd @@ -2,7 +2,8 @@ % Please edit documentation in R/layer_attributes.R \name{layer_attributes_tbl} \alias{layer_attributes_tbl} -\title{Get layer attribute values tibble} +\title{Possible values of variables (attributes) in a dataset (layer) +from a data source (service).} \usage{ layer_attributes_tbl(wfs = NULL, service = NULL, service_version = NULL, layer) } @@ -24,8 +25,7 @@ tibble of layer attribute (variable) values with geometry column removed. } \description{ -Possible values of variables (attributes) in a dataset (layer) -from a data source (service). +Get layer attribute values tibble } \details{ Request excluding spatial information can be significantly faster. diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index cf979d8..a43564a 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -28,13 +28,13 @@ articles: - '`articles/request-params`' reference: -- title: Download information about web services +- title: Download information about data sources contents: - '`emodnet_wfs`' - '`emodnet_init_wfs_client`' - '`emodnet_get_wfs_info`' -- title: Download layers, or information about layers +- title: Download data or metadata contents: - '`emodnet_get_layers`' - '`layer_attribute_descriptions`'