R/has.R

Defines functions has_attribute has_name

has_attribute <- function(x, which) {
  !is_null(attr(x, which, TRUE))
}

has_name <- function(x, which) {
  length(which) == 1 && which %in% names(x)
}
imanuelcostigan/predrcats documentation built on May 18, 2019, 4:45 a.m.