is.binary {WinRatio} | R Documentation |
Binary Vectors
Description
is.binary is used to test if a vector is of binary type, i.e. if a vector contains only 0 and/or 1 values.
Usage
is.binary(x)
Arguments
x |
a vector to be tested. |
Value
is.binary returns TRUE or FALSE depending on whether a vector is of binary type or not.
Examples
x1 <- runif(100, 0, 1)
x2 <- ifelse(x1 < 0.5, 1, 0)
is.binary(x1)
is.binary(x2)
[Package WinRatio version 1.0 Index]