extr_val {gcplyr} | R Documentation |
Extract parts of an object
Description
A wrapper for [
with handling of NA's for use in
dplyr::summarize()
Usage
extr_val(x, i, allNA_NA = TRUE, na.rm = TRUE)
Arguments
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. |
Value
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
[Package gcplyr version 1.10.0 Index]