Re: [Rd] Unexpected argument-matching when some are missing

2018-11-30 Thread Michael Lawrence
Argument matching is by name first, then the still missing arguments are filled positionally. Unnamed missing arguments are thus left missing. Does that help? Michael On Fri, Nov 30, 2018 at 8:18 AM Emil Bode wrote: > > But the main point is where arguments are mixed together: > > > debugonce(plo

Re: [Rd] Unexpected argument-matching when some are missing

2018-11-30 Thread Emil Bode
But the main point is where arguments are mixed together: > debugonce(plot.default) > plot(x=1:10, y=, 'l') ... Browse[2]> missing(y) [1] FALSE Browse[2]> y [1] "l" Browse[2]> type [1] "p" I think that's what I fall over mostly: that named, empty arguments behave entirely different from omitting

Re: [Rd] Unexpected argument-matching when some are missing

2018-11-30 Thread S Ellison
> Yes, I think all of that is correct. But y _is_ missing in this sense: > > plot(1:10, y=) > > ... > Browse[2]> missing(y) Although I said what I meant by 'missing' vs 'not present', it wasn't exactly what missing() means. My bad. missing() returns TRUE if an argument is not specified in the cal

Re: [Rd] Unexpected argument-matching when some are missing

2018-11-30 Thread Emil Bode
It looks like you're right that somewhere in (presumably) match.call, the named, empty arguments are removed, such that the call plot(x=1:10, y=, 10:1) is translated to plot(x=1:10, 10:1). But I would have expected it to be the same as plot(x=1:10, , 10:1) (note the ", ,"), which gives an error