R/listregions.R

Defines functions listregions

Documented in listregions

#' List available regions for a region type
#'
#' @export
#' @param region (character) region type
#' @param ... curl options passed on to [crul::HttpClient()]
#' @return a data frame with columns:
#'
#' - region title
#' - region ID
#'
#' @examples \dontrun{
#' listregions(region = "eez")
#' }
listregions <- function(region, ...) {
  data <- callapi(paste0("api/v1/", region, "/"), list(nospatial = "true"), ...)
  return(data)
}
ropensci/seaaroundus documentation built on March 4, 2020, 9:02 a.m.