AW: [Rd] Proposal: Generalizing unique() and duplicated()

Kaspar Pflugshaupt
Tue, 6 Feb 2001 16:51:34 +0100

On Tuesday 06 February 2001 13:49, Prof Brian Ripley wrote:

> Method dispatch is far from free (it is quite slow). Do we want to
> encumber unique() (a fast internal function) in this way?

That's a good argument. I did not know dispatch was such a problem in terms 
of speed. J. Oelschlägel suggested eliminating two dispatches by calling 


instead of


in both duplicated.matrix() and
But the speed gain, following your second argument, would probably be 
marginal. And the default methods would still get dispatched.

> There are better ways to do this if one is going to use C code:
> converting to character and comparing long strings are both expensive,

Since I cannot write C, this is not an option for me. I guess I'll take back 
my proposal and use the functions privately. I might publish them on r-help 
(in a non-dispatched form, not overloading the original functions), so others 
can use them as well.

Thanks for the feedback (I learned a lot)

Kaspar Pflugshaupt


Kaspar Pflugshaupt
Geobotanical Institute
ETH Zurich, Switzerland

r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: