Investigate missingness
sum_NA(x) sum_NaN(x) sum_blank(x)
x | a vector with multiple elements |
---|
The number of non-elements so defined
These functions return the number of NA, NaN, or blank values in a vector. Such information can serve as a diagnostic or used outright, e.g. in longitudinal settings. If you are dealing with singletons, you should just use the underlying function, e.g. is.na. For total blank values, the stringi package is required.
For more in this realm, I suggest you visit naniar.
#> [1] 2#> [1] 2#> [1] 1sum_NA(1:4)#> [1] 0