notna: drop NA values from vector

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

View source: R/regr.R

Description

Return the vector 'x', without elements that are NA or NaN or, if 'inf' is TRUE, equal to Inf or -Inf

Usage

1
notna(x, inf = TRUE)

Arguments

x

vector from which the non-real values should be dropped

inf

Should 'Inf' and '-Inf' be considered "non-real"?

Value

Vector containing the 'real' values of 'x' only

Note

The differences to 'na.omit(x)' are: 'Inf' and '-Inf' are also dropped, unless 'inf==FALSE'.\ no attribute 'na.action' is appended.

Author(s)

Werner A. Stahel

See Also

na.omit

Examples

1
2
3
dd <- c(1, NA, 0/0, 4, -1/0, 6)
notna(dd)
na.omit(dd)

regr0 documentation built on May 31, 2017, 2:26 a.m.