na_gaps: Finding Gaps of NAs

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

Description

Computes lengths and frequencies of NA gaps, i.e. sequences of consecutive NAs, in a vector or data frame.

Usage

1

Arguments

x

A vector or data frame.

Details

If the input is a data frame, a missing value is always defined as a not complete case, i.e. each row containing an NA is treated as a missing observation.

Value

A list with three elements of class 'na_gaps'.

table

A table of gap lengths and corresponding frequencies.

lengths

A vector of gap lengths, actually the names of list element table.

number

The number of incomplete cases.

Author(s)

J. Gross, A. Moeller.

See Also

complete.cases

Examples

1
na_gaps(c(1, NA, NA, 1, 1, NA, NA, NA, 1, NA, NA, 1, 1, 1, NA, NA))

JuGross/ensAR documentation built on May 10, 2019, 8:23 a.m.