R/dpresourcenames.R

Defines functions dpresourcenames

Documented in dpresourcenames

#' Get the names of the resources in a Data Package
#'
#' @param dp A \code{datapackage} object.
#'
#' @return
#' Returns a character vector with the names of the data resources in the Data
#' Package.
#'
#' @export
dpresourcenames <- function(dp) {
  resources <- sapply(dpproperty(dp, "resources"), function(r) {
    if (!exists("name", r)) stop("Resource without name.")
    r$name
  })
  resources
}
djvanderlaan/datapackage documentation built on March 18, 2024, 4:57 p.m.