View source: R/utility_functions.R
extr_val | R Documentation |
A wrapper for [
with handling of NA's for use in
dplyr::summarize()
extr_val(x, i, allNA_NA = TRUE, na.rm = TRUE)
x |
object from which to extract element(s) |
i |
index specifying element to extract. |
allNA_NA |
logical indicating whether |
na.rm |
a logical indicating whether missing index values should be removed. |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.