firstNA: Position of first NA

Description Usage Arguments Value See Also Examples

View source: R/integerutil.R

Description

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

Usage

1

Arguments

x

an R vector

Value

a reversed vector

See Also

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

Examples

1
2
3
4
5
6
7
8
9
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 documentation built on Aug. 4, 2020, 9:06 a.m.