A wrapper for [
with handling of NA's for use in
dplyr::summarize()
extr_val(x, i, allNA_NA = TRUE, na.rm = TRUE)
If all_NA = FALSE
and na.rm = FALSE
, identical to
x[i]
.
If all_NA = FALSE
and na.rm = TRUE
, identical to
x[i[!is.na(i)]]
.
If all_NA = TRUE
, identical to x[i]
unless
all(is.na(i)) == TRUE
, in which case returns NA
object from which to extract element(s)
index specifying element to extract.
logical indicating whether NA
should be returned
when all(is.na(i)) == TRUE
.
a logical indicating whether missing index values should be removed.