From l@wrence@mich@el @ending from gene@com  Fri Nov 30 17:24:31 2018
From: l@wrence@mich@el @ending from gene@com (Michael Lawrence)
Date: Fri, 30 Nov 2018 08:24:31 -0800
Subject: [Rd] Unexpected argument-matching when some are missing
In-Reply-To: <F12950C3-65ED-457A-82BF-310F90EF9609@dans.knaw.nl>
References: <AA681EA4-D0C7-4A2F-A719-01E510635C45@dans.knaw.nl>
 <2ffdc3d61fcd4b098fa37a35a5cdffc9@GBDCVPEXC08.corp.lgc-group.com>
 <CA+vqiLFUYr5-OzJ7FmrjhT5owEiTJ2Q9x-O5mbv-tx=9c8iCaA@mail.gmail.com>
 <f29d8c1252094e82a30ef8c92b8808d4@GBDCVPEXC08.corp.lgc-group.com>
 <CA+vqiLF8DLiYx8Fp=QiHRtqA9_cNdxGWKe-SxVGq1QatZaCqnQ@mail.gmail.com>
 <b42a529f59634ed282821ddd23608e26@GBDCVPEXC08.corp.lgc-group.com>
 <F12950C3-65ED-457A-82BF-310F90EF9609@dans.knaw.nl>
Message-ID: <CAOQ5Nydwa1CqaA2oYmDwcVaWpg8Z6gRqDC2Ze4RG-Jcb-z_uWQ@mail.gmail.com>

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 <emil.bode at dans.knaw.nl> wrote:
>
> 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 them (", ,")
>
> And I definitely agree we need a guru to explain it all to us (
>
> Cheers, Emil Bode
>
>
> ?On 30/11/2018, 15:35, "S Ellison" <S.Ellison at LGCGroup.com> wrote:
>
>     > 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 call _whether or not_ it has a default, hence the behaviour of missing(y) in debug(plot).
>
>     But we can easily find out whether a default has been assigned:
>     plot(1:10, y=, type=)
>     Browse[2]> y
>     NULL
>     Browse[2]> type
>     "p"
>
>     ... which is consistent with silent omission of 'y=' and 'type='
>
>
>     Still waiting for a guru...
>
>     Steve E
>
>
>
>     *******************************************************************
>     This email and any attachments are confidential. Any use, copying or
>     disclosure other than by the intended recipient is unauthorised. If
>     you have received this message in error, please notify the sender
>     immediately via +44(0)20 8943 7000 or notify postmaster at lgcgroup.com
>     and delete this message and any copies from your computer and network.
>     LGC Limited. Registered in England 2991879.
>     Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Unexpected argument-matching when some are missing
Michael Lawrence