# NOT RUN {
option_list = c("default", "par.observed", "empirical")
xmu_match.arg("par.observed", option_list)
xmu_match.arg("allow me", option_list, check = FALSE)
xmu_match.arg(option_list, option_list)
option_list = c(NULL, "par.observed", "empirical")
# fails with NULL!!!!!
xmu_match.arg(option_list, option_list)
option_list = c(NA, "par.observed", "empirical")
xmu_match.arg(option_list, option_list) # use NA instead
option_list = c(TRUE, FALSE, NA)
xmu_match.arg(option_list, option_list) # works with non character
# An example of checking a bad item and stopping
# }
# NOT RUN {
xmu_match.arg("bad", option_list)
# }
Run the code above in your browser using DataLab