R/check_some_missing.R

Defines functions check_some_missing

Documented in check_some_missing

#' Check if some missing values are present
#'
#' Check if some missing values are present, but not all are missing.
#' returns a boolean. This check is done to save time for vectors where filling
#' is not needed
#'
#' @param x the vector to check
#' @return TRUE or FALSE
check_some_missing <- function(x) {
    x <- unique(x)
    any(is.na(x)) & !all(is.na(x))
}
jelger12/fillr documentation built on Jan. 29, 2020, 3:35 p.m.