Learn R Programming

crtests (version 0.2.1)

na_count: Count the number of NAs in an object

Description

Count the number of NAs in an object

Usage

na_count(x, ...)
"na_count"(x, columns = c(), ...)
"na_count"(x, ...)

Arguments

x
An object, either a vector or a data.frame
...
Extra arguments to na_count
columns
Vector of column names

Methods (by class)

  • data.frame: If columns are specified, returns the maximum of the count of NAs for those columns. Otherwise, it returns the number of rows that have a NA in any column.
  • default: Calls na.omit on x, and returns the length of the result. This is only meaningful for one-dimensional objects (vectors).