[R] Error with named definition argument to match.call

David Winsemius dwinsemius at comcast.net
Wed Jul 16 01:27:28 CEST 2014


The help page says:

"Calling match.call outside a function without specifying definition  
is an error."

And yet when I send a function with a 'definition' argument it errors:

 > g
function(x, y=NULL, z=NULL) invisible(NULL)
 > match.call(definition=g)
Error in match.call(definition, call, expand.dots) :
   unused argument(s) (definition = g)

I wondered if this had something to do with primitive functions and  
their ignoring names but:

 > is.primitive(match.call)
[1] FALSE

Calling with an unnamed first argument succeeds:

 > match.call(g )
match.call(x = g)
-- 

David Winsemius, MD
Alameda, CA, USA



More information about the R-help mailing list