powered by
Creates a vector of the integers 1 and 0. If condition is true it returns 1. If false 0. If condition returns NA it returns NA, if not explicitly not stated than NA should be replaced.
dummy(condition, missing = NA) dummy_(condition, missing = 0L)dummy_(condition, missing = 0L)
dummy_(condition, missing = 0L)
a vector of the integers 1, 0 and NA (if not dummy_ is used).
a predicament
a replacement if condition is NA
vignette("hablar")
v <- c(10, 5, 3, NA, 9) dummy(v > 5) dummy_(v > 5)
Run the code above in your browser using DataLab