powered by
TRUE
Find the index of first/last TRUE value in a logical vector.
which.first(x, use.names = TRUE)which.last(x, use.names = TRUE)
which.last(x, use.names = TRUE)
[integer(1) | integer(0)]. Returns the index of the first/last TRUE value in x or an empty integer vector if none is found.
integer(1)
integer(0)
x
[logical] Logical vector.
logical
[logical(1)] If TRUE and x is named, the result is also named.
logical(1)
which.first(c(FALSE, TRUE)) which.last(c(FALSE, FALSE))
Run the code above in your browser using DataLab