R/is_spec__and__is_ref.R

Defines functions is_nested is_ref is_spec

is_spec <- function(x) {
  return(("justifierSpec" %in% class(x)) || length(names(x)) > 1);
}

is_ref <- function(x) {
  return(("justifierRef" %in% class(x)) || ((length(names(x)) == 0) && (is.character(x))));
}

is_nested <- function(x) {
  return(is.list(x) && any(unlist(lapply(x, is.list))));
}
Matherion/justifier documentation built on Dec. 31, 2020, 3:13 p.m.