Learn R Programming

ryouready (version 0.4)

count_na: Count the number of NAs in each row or in each column

Description

Count the number of NAs in each row or in each column

Usage

count_na(x, along = 1)

Arguments

x
A dataframe or matrix.
along
Along which dimension to count the NAs in (1 = rows, 2=columns).

Value

A vector givning the number of NAs for each row or column.

Examples

Run this code
x <- d.ngo

# count NAs row-wise across all variables
count_na(x)

# count NAs column-wise
count_na(x, along=2)

Run the code above in your browser using DataLab