is.single.slot | R Documentation |
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...
is.single.slot(x, NULL.is.single = FALSE)
x |
the thing to be tested |
NULL.is.single |
should NULL be considered a single slot or not (default: not) |
TRUE if is single slot, FALSE otherwise
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.