powered by
which
Unwhich(idx, n, useNames = TRUE)
TRUE
i
ll <- c(TRUE, FALSE, TRUE, NA, FALSE, FALSE, TRUE) names(ll) <- letters[seq(ll)] i <- which(ll) # back again (loosing the names of the FALSEs) Unwhich(i, length(ll))
Run the code above in your browser using DataLab