which.first {BBmisc} | R Documentation |
Find the index of first/last TRUE
value in a logical vector.
Description
Find the index of first/last TRUE
value in a logical vector.
Usage
which.first(x, use.names = TRUE)
which.last(x, use.names = TRUE)
Arguments
x |
[ |
use.names |
[ |
Value
[integer(1)
| integer(0)
].
Returns the index of the first/last TRUE
value in x
or
an empty integer vector if none is found.
Examples
which.first(c(FALSE, TRUE))
which.last(c(FALSE, FALSE))
[Package BBmisc version 1.13 Index]