is.single.slot {GROAN} | R Documentation |
Is a single slot thing?
Description
Checks if the passed variable is a single slot thing, meaning it contains only a single value (numeric, character, whatever) and nothing more. Works with array, vectors, matrix, data.frame...
Usage
is.single.slot(x, NULL.is.single = FALSE)
Arguments
x |
the thing to be tested |
NULL.is.single |
should NULL be considered a single slot or not (default: not) |
Value
TRUE if is single slot, FALSE otherwise
Examples
is.single.slot(5) #TRUE
is.single.slot('foobar') #TRUE
is.single.slot(NULL) #depends on NULL.is.single
is.single.slot(NA) #TRUE
is.single.slot(c(1,2,5)) #FALSE
is.single.slot(matrix(0, 10, 5)) #FALSE
is.single.slot(matrix(0, 1, 1)) #TRUE
[Package GROAN version 1.3.1 Index]