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

2018-12-03 Thread Emil Bode
Thanks as well! I'm now getting how it's exactly matched, but it still "feels wrong". Martins rewording is exactly what I meant/was concerned about. My intuition would say that anyone using ff(x=, ...) would not intent x to be matched to something else, but maybe I'm overlooking certain cases. Any

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

2018-12-03 Thread Martin Maechler
> Michael Lawrence > on Fri, 30 Nov 2018 08:24:31 -0800 writes: > Argument matching is by name first, then the still missing > arguments are filled positionally. Unnamed missing > arguments are thus left missing. Does that help? Thank you, Michael! Unfortunately, it may n

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

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

2018-11-29 Thread Ista Zahn
On Thu, Nov 29, 2018 at 1:10 PM S Ellison wrote: > > > > > plot(x=1:10, y=) > > > plot(x=1:10, y=, 10:1) > > > > > > In both cases, 'y=' is ignored. In the first, the plot is for y=NULL (so > > > not > > 'missing' y) > > > In the second case, 10:1 is positionally matched to y despite the > > > i

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

2018-11-29 Thread S Ellison
> > plot(x=1:10, y=) > > plot(x=1:10, y=, 10:1) > > > > In both cases, 'y=' is ignored. In the first, the plot is for y=NULL (so not > 'missing' y) > > In the second case, 10:1 is positionally matched to y despite the > > intervening > 'missing' 'y=' > > > > So it isn't just 'missing'; it's 'not

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

2018-11-29 Thread Emil Bode
Well, I did mean it as "missing". To me, it felt just as natural as providing an empty index for subsetting (e.g. some.data.frame[,,drop=FALSE]) I can't think of a whole lot of other uses than subsetting, but I think this issue may be mostly important when you're not entirely sure what a call is

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

2018-11-29 Thread Ista Zahn
ll' What exactly is the difference between "missing" and "not there at all"? --Ista > > Steve E > > > -Original Message----- > > From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Emil > > Bode > > Sent: 29 November 2018

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

2018-11-29 Thread S Ellison
alf Of Emil > Bode > Sent: 29 November 2018 10:09 > To: r-devel@r-project.org > Subject: [Rd] Unexpected argument-matching when some are missing > > When trying out some variations with `[.data.frame` I noticed some (to me) > odd behaviour, which I found out has nothing to do

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

2018-11-29 Thread Ista Zahn
On Thu, Nov 29, 2018 at 5:09 AM Emil Bode wrote: > > When trying out some variations with `[.data.frame` I noticed some (to me) > odd behaviour, which I found out has nothing to do with `[.data.frame`, but > rather with the way arguments are matched, when mixing named/unnamed and > missing/non-

[Rd] Unexpected argument-matching when some are missing

2018-11-29 Thread Emil Bode
When trying out some variations with `[.data.frame` I noticed some (to me) odd behaviour, which I found out has nothing to do with `[.data.frame`, but rather with the way arguments are matched, when mixing named/unnamed and missing/non-missing arguments. Consider the following example: myfun