R/content_checks.R

Defines functions is.binary is.constant

Documented in is.binary is.constant

#' Contents of Vector Checks
#'
#' Misc/useful functions to easily determine what is contained in a vector.
#'
#' @param x object to be tested
#'
#' @return a logical value
#'
#' @name content_checks
NULL

#' @rdname content_checks
#' @export
is.constant <- function(x){
  n_unique_cc(x) <= 1
}

#' @rdname content_checks
#' @export
is.binary <- function(x){
  n_unique_cc(x) <= 2
}
BenWiseman/roperators documentation built on Feb. 3, 2025, 10:33 a.m.