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
The documentation of 'base::cut' says:
... the factor level labels are constructed as "(b1, b2]", "(b2, b3]" etc...
In reality, the spaces after the commas are missing. I like the
documented behavior better than the actual, though.
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64
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-
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
Thanks Emil for your thorough answer. It really clarified a lot to me. And
revealed (even more of) my ignorance.
>-Original Message-
>From: Emil Bode
>Sent: Thursday, November 29, 2018 10:48 AM
>To: Henrik Pärn ; r-devel@r-project.org
>Subject: Re: [Rd] named arguments discouraged in `[.
Well, the situation with `[.data.frame` (and [<-) is complicated by the fact
that the data.frame-method is not a primitive, but the generic IS.
I'm not sure about dispatch for primitive-generics, but I bet it's done on the
first argument (as with S3). Which means `[`(j=1:2,d,i=1) has nothing to
Thanks Bill and Michael for taking the time to share your knowledge!
As a further background to my question, here are two examples that I forgot to
include in my original post (reminded by Michael's answer). I swapped the i and
j arguments in `[.data.frame` and `[<-.data.frame`. With warnings,
11 matches
Mail list logo