Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

which.na

Determine Which Values are Missing Values


Description

Returns an integer vector describing which values in the input vector, if any, are missing.

Usage

which.na(x)

Arguments

x

an R object, which should be of mode "logical", "numeric", or "complex".

Value

an integer vector describing which values in the input vector, if any, are missing.

See Also

Examples

## A non-zero number divided by zero creates 
## infinity, zero over zero creates a NaN 
weird.values <- c(1/0, -20.9/0, 0/0, NA)

## Produces: 3 4. In this example, the which.na 
## expression and the subscript expression 
## involving is.na should return the same value 
which.na(weird.values)
seq(along=weird.values)[is.na(weird.values)]

splus2R

Supplemental S-PLUS Functionality in R

v1.3-3
GPL-2
Authors
William Constantine [aut], Tim Hesterberg [aut], Knut Wittkowski [ctb], Tingting Song [ctb], Bill Dunlap [ctb], Stephen Kaluzny [ctb, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.