is.01 | R Documentation |
Check if a variable is 0/1 encoded
is.01(x, na.rm = FALSE)
x |
a vector |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
boolean
JuG
testDf <- data.frame(a = runif(10),
b = rbinom(10, size = 1, prob = .2),
c = as.Date(Sys.time())- 10:1,
d = factor(x = rep(3,10)),
e = NA,
f = rep(0,10),
g = rep(1,10),
h = sample(x = c(0,1,NA), size = 10, replace = T),
i = sample(x = c(0,NA), size = 10, replace = T),
j = sample(x = c(1,NA), size = 10, replace = T))
sapply(testDf, FUN=is.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.