diff --git a/R/client.R b/R/client.R index ee52082..c66006c 100644 --- a/R/client.R +++ b/R/client.R @@ -1,4 +1,6 @@ -#' Initialise an EMODnet WFS client +#' @description Initialise an EMODnet WFS client +#' +#' @title Connect to a data source (service) #' #' @param service the EMODnet OGC WFS service name. #' For available services, see [`emodnet_wfs()`]. @@ -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/R/emodnet_wfs.R b/R/emodnet_wfs.R index 6dffbc8..7c2f544 100644 --- a/R/emodnet_wfs.R +++ b/R/emodnet_wfs.R @@ -4,11 +4,13 @@ stringsAsFactors = FALSE ) } -#' Available EMODnet Web Feature Services +#' @description Available EMODnet Web Feature Services +#' +#' @title 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/R/info.R b/R/info.R index 270c8ee..e54abfb 100644 --- a/R/info.R +++ b/R/info.R @@ -76,18 +76,22 @@ 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 +#' +#' @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. #' #' @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. #' @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") @@ -95,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/R/layer_attributes.R b/R/layer_attributes.R index aed0302..aa72b5f 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, @@ -33,22 +32,23 @@ layer_attributes_summarise <- function(wfs = NULL, ) } -#' Get layer attribute description +#' @description Get layer attribute description +#' +#' @title 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 #' #' @return data.frame containing layer attribute descriptions (metadata). +#' @family attributes #' @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) { @@ -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, @@ -96,7 +97,10 @@ layer_attributes_get_names <- function(wfs = NULL, )$name } -#' Inspect layer attributes +#' @description Inspect layer attributes +#' +#' @title 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 @@ -107,17 +111,16 @@ 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 #' -#' @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, @@ -161,7 +164,10 @@ layer_attribute_inspect <- function(wfs = NULL, ) } -#' Get layer attribute values tibble +#' @description Get layer attribute values tibble +#' +#' @title Possible values of variables (attributes) in a dataset (layer) +#' from a data source (service). #' #' @inheritParams emodnet_init_wfs_client #' @inheritParams emodnet_get_wfs_info @@ -174,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/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 f7841ce..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, @@ -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..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) @@ -14,7 +17,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 @@ -53,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") @@ -61,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} } diff --git a/man/emodnet_init_wfs_client.Rd b/man/emodnet_init_wfs_client.Rd index b2c4696..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) } @@ -25,9 +25,9 @@ OGC Web Feature Service. Initialise an EMODnet WFS client } \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}. diff --git a/man/emodnet_wfs.Rd b/man/emodnet_wfs.Rd index f437e6c..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() } @@ -13,5 +13,7 @@ Tibble of available EMODnet Web Feature Services Available EMODnet Web Feature Services } \examples{ +\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} emodnet_wfs() +\dontshow{\}) # examplesIf} } diff --git a/man/layer_attribute_descriptions.Rd b/man/layer_attribute_descriptions.Rd index 4634c68..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, @@ -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()}}.} @@ -31,10 +31,18 @@ data.frame containing layer attribute descriptions (metadata). Get layer attribute description } \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} } +\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 31f7b6d..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, @@ -14,7 +15,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()}}.} @@ -37,12 +38,20 @@ factor or character variable levels or unique values. Inspect layer attributes } \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} } +\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 84819c5..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, @@ -13,7 +14,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()}}.} @@ -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 e05085a..fc73e41 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()}}.} @@ -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 b456d0b..3cd6952 100644 --- a/man/layer_attributes_tbl.Rd +++ b/man/layer_attributes_tbl.Rd @@ -2,13 +2,14 @@ % 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) } \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()}}.} @@ -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:" + ) +) 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`'