[R] no partial matching of argument names after dots argument - why?

Patrick Burns pburns at pburns.seanet.com
Mon Mar 5 12:37:27 CET 2012


Circle 8.1.20 of 'The R Inferno'

http://www.burns-stat.com/pages/Tutor/R_inferno.pdf

gives the rules for argument matching.
When you see them explicitly set out there,
perhaps you will see why the matching
is as it is.

Pat

On 05/03/2012 09:24, Mark Heckmann wrote:
> I noticed that the argument names after the dots argument are not partially matched.
>
> foo<- function(one, two, ...){
>    one + two
> }
>> foo(o=1, t=2)
> [1] 3
>
> foo<- function(one, ..., two){
>     one + two
> }
>
>> foo(o=1, t=2)
> Fehler in one + two : 'two' fehlt
>
>
> Can someone explain me the reason for this behavior?
>
> THX
> Mark
>
> ––––––––––––––––––––––––––––––––––––
> Mark Heckmann
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Patrick Burns
pburns at pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')



More information about the R-help mailing list