# No error
input = TRUE
arg_match0_true_or_false(input)
# Allow NA
input = NA
arg_match0_true_or_false(input)
# Error as 0 is not TRUE or FALSE
input = 0
try(arg_match0_true_or_false(input))
# Error as 1 is not TRUE or FALSE
input = 1
try(arg_match0_true_or_false(input))
# Error as NULL is not TRUE or FALSE
input = NULL
try(arg_match0_true_or_false(input))
# Error as NA is not TRUE or FALSE and allow_na is FALSE
input = NA
try(arg_match0_true_or_false(input, allow_na = FALSE))
Run the code above in your browser using DataLab