[Rd] Unexpected argument-matching when some are missing

S Ellison S@Elli@on @ending from LGCGroup@com
Fri Nov 30 15:34:59 CET 2018

> 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
Browse[2]> type

... 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 using 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

More information about the R-devel mailing list