View source: R/is_logicalish.R
| is_logicalish | R Documentation |
Check if an object is logical or numeric with only 0s and 1s
is_logicalish(x)
x |
An R object to check. |
A logical value indicating whether x is logical or numeric
containing only 0s and 1s.
Michal Burda
is_logicalish(c(TRUE, FALSE, NA)) # returns TRUE
is_logicalish(c(0, 1, 1, 0, NA)) # returns TRUE
is_logicalish(c(0.0, 1.0, NA)) # returns TRUE
is_logicalish(c(0, 0.5, 1)) # returns FALSE
is_logicalish("TRUE") # returns FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.