na.check: Basic info on each col of data.frame

View source: R/na.check.R

na.checkR Documentation

Basic info on each col of data.frame

Description

Returns basic information on each field in a data.frame, like count of rows that are zero, negative, NA, infinite, etc.

Slow - work in progress Leaves out logical, complex?, character, etc. cols

Usage

na.check(df, zone, min.text = FALSE)

Arguments

df

Matrix or data.frame to examine. Cannot be a single vector currently.

zone

optional. if zone (subgroups) specified, just returns total count and count of NA values – in each subgroup for each field.

min.text

Logical, optional, defaults to FALSE. If TRUE, tries to find minimum of numbers stored as text? Slows it down.

Value

Returns a vector of results, one per col of df But if zone (subgroups) specified, just returns count of NA values in each subgroup for each field.

See Also

matrixStats::signTabulate() minNonzero() and experimental variations on na.check: na.check() na.check2()

Examples

## Not run: 
system.time(x = na.check(data.frame(a = -1:1e6, b = 'text', c = c(NA, 1, 2)), min.text = FALSE) )
system.time(x = na.check2(data.frame(a = -1:1e6, b = 'text', c = c(NA, 1, 2)), min.text = TRUE) )
na.check(data.frame(a = -1:10, b = 'text', c = c(NA, 1, 2)))
na.check2(data.frame(a = -1:10, b = 'text', c = c(NA, 1, 2)))

## End(Not run)

ejanalysis/analyze.stuff documentation built on April 2, 2024, 10:10 a.m.