swfscMisc (version 1.6.5)

na.count: Count NAs

Description

Counts NAs in an object.

Usage

na.count(x)

Arguments

x

a vector, data.frame, or matrix.

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
x <- sample(c(1:10, NA), 30, replace = TRUE)
na.count(x)
x.df <- do.call(data.frame, lapply(1:4, function(i) sample(c(1:10, NA), 30, replace = TRUE)))
colnames(x.df) <- paste("X", 1:4, sep = "")
na.count(x.df)

Run the code above in your browser using DataLab