From murdoch@stats.uwo.ca  Tue Nov 26 14:29:09 2002
From: murdoch@stats.uwo.ca (Duncan Murdoch)
Date: Tue, 26 Nov 2002 09:29:09 -0500
Subject: [Rd] Re: unique()
In-Reply-To: <Pine.GSO.4.42.0211260844200.20783-100000@elios>
References: <Pine.GSO.4.42.0211260844200.20783-100000@elios>
Message-ID: <3i07uus8o4b5sq8qag074s4gd3pvv1kbqb@4ax.com>

On Tue, 26 Nov 2002 08:48:37 +0000 (GMT), Peter Green  wrote in
message <Pine.GSO.4.42.0211260844200.20783-100000@elios>:

>Hi, Duncan,
>
>Just a quick query/grumble.... I've just noticed that
>the operation of unique() on arrays changed somewhere
>between Rw1041 and 1061 - pity, as I had been relying on the old
>action (treat the argument as a vector) in some code.
>I didn't notice it mentioned in any 'changes' documents.

It was mentioned in the 1.6.0 news file:

>   o   duplicated() and unique() have methods for matrices and arrays
>       (based on ideas from Jens Oehlschlgel).

There was a hint this was coming in the 1.4.0 news:

>    o   duplicated() and unique() are now generic functions with
>        methods for data frames (as well as atomic vectors).

You can get the old behaviour for arrays by unique(as.vector(x))
instead of unique(x), as you've probably figured out.

I wonder if there could be a mechanism that would warn about things
like this?  E.g. instead of a flat news file that you have to read all
through, maybe a database of changes, and a tool that could look
through your code and spot things whose usage had changed?
I think maintaining the accuracy of the database would be hard.

Duncan



[Rd] Re: unique()
Duncan Murdoch