mosaic (version 0.14.4)

n_missing: counting missing elements

Description

counting missing elements

Usage

n_missing(..., type = c("any", "all"))

Arguments

...

vectors of equal length to be checked in parallel for missing values.

type

one of "any" (default) or "all".

Examples

Run this code
# NOT RUN {
if (require(NHANES)) {
  tally( ~ is.na(Height) + is.na(Weight), data = NHANES, margins = TRUE)
  NHANES %>% 
    summarise(
      mean.wt = mean(Weight, na.rm = TRUE),
      missing.Wt = n_missing(Weight),
      missing.WtAndHt = n_missing(Weight, Height, type = "all"),
      missing.WtOrHt = n_missing(Weight, Height, type = "any")
      )
    }
# }

Run the code above in your browser using DataLab