Perform an operation on a vector that may be empty or all NA with controlled output.
fun_no_na.RdPerform an operation on a vector that may be empty or all NA with controlled output.
Usage
fun_no_na(x, FUN, zero_len = NULL)
max_no_na(x, zero_len = NA)
min_no_na(x, zero_len = NA)
median_no_na(x, zero_len = NA)
mean_no_na(x, zero_len = NA)
sd_no_na(x, zero_len = NA)Arguments
- x
The object to perform the operation on.
- FUN
The function to perform if the object is neither zero length or all
NA- zero_len
If
xhas length 0, then either return it (ifNULL) or returnNAof the same class asx(ifNA)