Skip to content
Prev 353760 / 398502 Next

match.arg: how to prevent users from not specifying a value

... and you could also use missing() (?missing for details) if you
wanted to give the user more verbose instructions, e.g.

   f1 <- function(type, ...) {
       if(missing(type)){
       cat("You must enter a 'type' argument that is one of etc....\n")
       return(invisible())
       }
       match.arg(type, c("A", "B", "C"))
   }
Bert Gunter

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
   -- Clifford Stoll
On Wed, Aug 19, 2015 at 9:19 AM, William Dunlap <wdunlap at tibco.com> wrote: