missingValueFunctions | R Documentation |
Functions to make code a little clearer. These are mainly ordinary functions,
like mean()
, with na.rm
set to TRUE
. For example,
meanNA()
is defined as function(x) mean(x, na.rm = TRUE)
.
allNA(x) lNA(x, verbose = FALSE) lNAv(x) maxNA(x) meanNA(x) medianNA(x) minNA(x) rangeNA(x) sdNA(x) sumNA(x) varNA(x)
x |
An R object. |
verbose |
Logical variable. If |
lNA(x)
returns its value silently. lNAv
is shorthand for
lNA(x, verbose = TRUE)
; it returns the same value as lNA(x)
but also prints the lengths of the vector before and after NAs are removed.
lNA(NA) # 0 x <- c(1:3, NA, 5) allNA(x <= 5) # TRUE lNA(x) # 4 lNAv(x) # 4 (length with NA=5) sum(NA) # NA sumNA(NA) # 0 sum(x) # NA sumNA(x) # 11 meanNA(x) # 2.75 sdNA(x) varNA(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.