# Error as input is NA but value list provided has no NA
input = NA
try(arg_match0_no_na_error_message(input, values = c("female","male")))
# No error as value list provided has NA
input = NA
arg_match0_allow_na(input, values = c("female","male", NA))
# No error as input is not NA
input = "male"
arg_match0_allow_na(input, values = c("female","male", NA))
Run the code above in your browser using DataLab