firstNA: Position of first NA

View source: R/integerutil.R

firstNAR Documentation

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

which.max, is.na, anyNA, anyDuplicated, bit_anyDuplicated

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)

truecluster/bit documentation built on Nov. 20, 2022, 2:34 a.m.