which
Showing the indexes of the elements that are TRUE in a boolean vector
examples/vectors/which.R
n = c(2, 4, 7, 6, 9, 8) which(n > 4) which(n > 4 & n %% 2)
Showing the indexes of the elements that are TRUE in a boolean vector
n = c(2, 4, 7, 6, 9, 8) which(n > 4) which(n > 4 & n %% 2)