# Not a binary factor. 0 levels
check_outcomes_are_binary(data.frame(x = 1))
# Not a binary factor. 1 level
check_outcomes_are_binary(data.frame(x = factor("A")))
# All good
check_outcomes_are_binary(data.frame(x = factor(c("A", "B"))))
Run the code above in your browser using DataLab