Description Usage Arguments Value Examples
Little helper functions that are often useful.
distinct()
returns the number of unique element in x
.
allNA()
tests if all elements of x
are NA.
integer_digits()
gives the number of integer digits in a number (i.e., number of digits to the left of the decimal place).
1 2 3 4 5 | distinct(x, ...)
allNA(x)
integer_digits(x)
|
x |
An R object, usually a vector. |
... |
Other arguments to pass to |
distinct()
just calls length(unique(x, ...))
, and returns a length 1 numeric with the number of unique elements in x
.
allNA()
just calls all(is.na(x))
, and returns TRUE
if all elements of x
are NA, FALSE
otherwise.
integer_digits()
is roughly the same as nchar(abs(trunc(x)))
, but much faster, and returns a length 1 numeric.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.