Learn R Programming

na.tools (version 0.3.1)

n_na: Counts how many values are NA

Description

Returns the number of values that are NA

Usage

n_na(x)

na.howmany(x)

na.n(x)

pct_na(x)

na.pct(x)

Arguments

x

object to count how many values are NA

Value

n_na returns an integer. pct_na returns a numeric value 0-1.

Details

n_na counts the number of missing values. na.n is an alias in the dplyr style.

pct_na gives the percentage of values that are NA

Examples

Run this code
# NOT RUN {
  x <- c( 1, NA, NA, 4:5 )
  n_na(x)
  pct_na(x)

# }

Run the code above in your browser using DataLab