R/missing_count.R

Defines functions missing_count

Documented in missing_count

#' missing_count
#' @title Missing Count
#' @description Count the number of missing values in a vector.
#' @param x vector
#' @return Number of missing values in the given set of values
#' @export
#' @author Jayachandra N
#' @examples
#' missing_count(c(1,2,3))
#' missing_count(c(NA, 1, NA, "NULL", ""))
missing_count <- function(x) {
  count <- sum(is.na(x)) + sum(is.null(x)) + sum(na.omit(x == "NA" | x == "" | x== "NULL"))
  return(count)
}

Try the shinyr package in your browser

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

shinyr documentation built on Oct. 21, 2021, 5:07 p.m.