R/dp_nresources.R

Defines functions dp_nresources

Documented in dp_nresources

#' Return the number of resources in a Data Package
#'
#' @param dp A Data Package object.
#'
#' @return
#' Returns an integer with the number of resources in the Data Package.

#' @export
dp_nresources <- function(dp) {
  # If resources does not exist dp$resources will return NULL which has a 
  # length of 0
  length(dp_property(dp, "resources"))
}
djvanderlaan/datapackage documentation built on June 12, 2025, 2:44 a.m.