I have an r function in a package that I am developing, of the following format which downloads and returns a dataframe based on the argument arg1. arg1 can only be either of the options "datatype1" or "datatype2". Currently the function returns a NULL when any other value is put in for arg1. What is the best way to inform the user that it is an invalid argument and handle the else block?
output_data <- function(arg1 = "datatype1"){
if(arg1 == "datatype1){
return(dt1)
} else if (arg1 == "datatype2"){
return(dt2)
} else {
}
}