sumna: Count NAs

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Count the missing or non-finite values for each column of a matrix or data.frame

Usage

1
sumna(object, inf = TRUE)

Arguments

object

a vector, matrix, or data.frame

inf

if TRUE, Inf and NaN values are counted along with NAs

Value

numerical vector containing the missing value counts for each column

Note

This is a simple shortcut for apply(is.na(object),2,sum) or apply(!is.finite(object),2,sum)

Author(s)

Werner A. Stahel, ETH Zurich

See Also

is.na, is.finite

Examples

1
2
t.d <- data.frame(V1=c(1,2,NA,4), V2=c(11,12,13,Inf), V3=c(21,NA,23,Inf))
sumna(t.d)

regr0 documentation built on May 2, 2019, 4:52 p.m.