Inverse Which
The inverse function to which
creates a logical
vector/matrix from indices.
Unwhich(idx, n, useNames = TRUE)
idx |
the indices as returned by |
n |
integer, the length of the original vector. |
useNames |
logical, determining if the names of the indices should be preserved. |
a logical vector of the length n, with TRUE
on the positions i
.
Nick Sabbe
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))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.