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
#' listregions(region = "eez")
listregions <- function(region, ...) {
  data <- callapi(paste0("api/v1/", region, "/"), list(nospatial = "true"), ...)
  return(data)
}

Try the seaaroundus package in your browser

Any scripts or data that you put into this service are public.

seaaroundus documentation built on May 2, 2019, 8:20 a.m.