View source: R/integer_vector.R
is_binary_vector | R Documentation |
Checks if a vector contains only binary values (0 or 1)
is_binary_vector(
v,
allow_na_values = FALSE,
allow_degenerate = NULL,
allow_uniform = TRUE
)
v |
the vector |
allow_na_values |
if the vector can contain NA values. Default FALSE |
allow_degenerate |
deprecated. Use allow_uniform. |
allow_uniform |
if TRUE (the default), the vector is allowed to contain |
## Not run:
# For assertion.
# Will fail if v contains any value that is not either 0 or 1
assertthat::assert_that(qscheck::is_binary_vector(v))
# For check
if (qscheck::is_binary_vector(v)) {}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.