firstNA | R Documentation |
This is substantially faster than which.max(is.na(x))
firstNA(x)
x |
an R vector |
a reversed vector
which.max()
, is.na()
, anyNA()
, anyDuplicated()
, bit_anyDuplicated()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.