Re: [Rd] Argument "nomatch" matched by multiple actual arguments ... %in% -> match?!?

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Thu, 06 Mar 2008 12:12:59 -0800

Hi,

a follow up. If I replace all 'foo %in% bar' in setMethodS3.default() with is.element(foo, bar) the error goes away. Here is is.element():

> is.element

function (el, set)
match(el, set, 0) > 0
<environment: namespace:base>

Not much of a difference compared to "%in%"(),

> get("%in%")

function (x, table)
match(x, table, nomatch = 0) > 0
<environment: namespace:base>

except that the 'nomatch' argument is not named in is.element(). Also, none of calls used variable names 'x', 'table', 'el', 'set', or 'nomatch'.

/Henrik

On Thu, Mar 6, 2008 at 2:27 AM, Henrik Bengtsson <hb_at_stat.berkeley.edu> wrote:
> When I run R CMD check R.oo on R v2.7.0 devel (2008-03-04 r44677) on
> WinXP I get the following error while testing examples:
>
> Error in match(x, table, nomatch = 0) :
> formal argument "nomatch" matched by multiple actual arguments
> Calls: setMethodS3 -> setMethodS3.default -> %in% -> match
> Execution halted
>
> How is that even possible with:
>
> > get("%in%")
> function (x, table)
> match(x, table, nomatch = 0) > 0
> <environment: namespace:base>
>
> All '%in' statements in setMethodS3.default are of kind (foo %in%
> bar). The error does not happen if I run the example(Object)
> explicitly.
>
> /Henrik
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 06 Mar 2008 - 20:14:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Mar 2008 - 23:30:45 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive