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"))
}

Try the datapackage package in your browser

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

datapackage documentation built on June 8, 2025, 1:25 p.m.