R/npn_dataset.R

Defines functions npn_datasets

Documented in npn_datasets

#' Get Datasets
#'
#' Returns a complete list of information about all datasets integrated into the
#' NPN dataset. Data can then be pulled for individual datasets using their
#' unique IDs.
#' @export
#' @param ... Currently unused.
#' @returns tibble of datasets and their IDs.
#' @examples \dontrun{
#' npn_datasets()
#' }
npn_datasets <- function(...) {
  req <- base_req %>%
    httr2::req_url_path_append('observations/getDatasetDetails.json')
  resp <- httr2::req_perform(req)
  out <- httr2::resp_body_json(resp, simplifyVector = TRUE)
  #return
  tibble::as_tibble(out)
}
usa-npn/rnpn documentation built on June 14, 2025, 12:14 p.m.