Selecting multiple elements with [
NA values in the selection vector (indices, logical) are returned as NA
This is different to:
dplyr::filter(df, df$x > 0)dropsNAvalues- base R:
which(<logical vector>)dropsNAvalues- it filters a logical vector for
TRUEs and returns their index, e.g. inwhich(x > 0)
- it filters a logical vector for