R/check_names.R

Defines functions .check_names

#' Check for names
#'
#' @param x object to check
#' @param names names to look for
#'
#' @keywords internal
#' @noRd
#'
#' @return boolean, TRUE for error
.check_names <- function(x, names) {
  if (inherits(x, "list")) {
    if (any(unlist(lapply(x, function(y) !all(names %in% names(y)))))) {
      return(TRUE)
    }
  } else {
    if (!all(names %in% names(x))) {
      return(TRUE)
    }
  }
  FALSE
}

Try the GeoTox package in your browser

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

GeoTox documentation built on April 4, 2025, 5:07 a.m.