I think type should default to whatever prediction type you think is going to be the most common, and then in the documentation you mention the other accepted values for the type.
Then match with rlang::arg_match() which does not accept partial matches and gives nice error messages.
type <- "resp"
choices <- c("response", "conf_int")
rlang::arg_match(type, choices)
#> Error: `type` should be one of: "response" or "conf_int"
#> Did you mean "response"?
I disagree with the use of
match.arg()
for validation, as it accepts partial matches.It is mentioned here: https://tidymodels.github.io/model-implementation-principles/model-predictions.html
I think
type
should default to whatever prediction type you think is going to be the most common, and then in the documentation you mention the other accepted values for thetype
.Then match with
rlang::arg_match()
which does not accept partial matches and gives nice error messages.