R/check_area.R

Defines functions check_area

Documented in check_area

#' Validate area provided to mapping or charting function.
#'
#' Validate an area for a mapping function or another mapbaltimore function.
#'
#' @param area `sf` object with a column named "name."
#'
#' @export
#'
check_area <- function(area) {
  # Check if area is an sf object
  if (!("sf" %in% class(area))) {
    stop("The area must be an sf class object.")
  } else if (!("name" %in% names(area))) {
    stop("The area must have a 'name' column.")
  }
}
elipousson/mapbaltimore documentation built on April 2, 2024, 4:23 p.m.