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
> 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
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
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
> 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
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
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
> > 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
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
On Thu, Nov 29, 2018 at 10:51 AM S Ellison wrote:
>
> > When trying out some variations with `[.data.frame` I noticed some (to me)
> > odd behaviour,
>
> Not just in 'myfun' ...
>
> 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 (
> When trying out some variations with `[.data.frame` I noticed some (to me)
> odd behaviour,
Not just in 'myfun' ...
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 match
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-
12 matches
Mail list logo