View source: R/01_data_cleaning.R
is_binary | R Documentation |
Automatically detect binary (boolean) variables, even if there is NAs in the data.
is_binary(x)
x |
Any variable (vector, columns etc.) of any length. |
Logical (i.e. a TRUE or FALSE answer).
xx <- c(0, 0, 1, 0, NA)
is_binary(xx) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.