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

firstNA

Position of first NA


Description

This is substantially faster than which.max(is.na(x))

Usage

firstNA(x)

Arguments

x

an R vector

Value

a reversed vector

See Also

Examples

x <- c(FALSE,NA,TRUE)
firstNA(x)
reverse_vector(x)
## Not run: 
x <- 1:1e7
system.time(rev(x))
system.time(reverse_vector(x))

## End(Not run)

bit

Classes and Methods for Fast Memory-Efficient Boolean Selections

v4.0.4
GPL-2 | GPL-3
Authors
Jens Oehlschlägel [aut, cre], Brian Ripley [ctb]
Initial release
2020-08-03

We don't support your browser anymore

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