Re: [Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-28 Thread jochen laubrock
Still, from a user's perspective this behavior is somewhat irritating. Wouldn't it be better to rewrite unique.matrix to use formatC or sprintf instead of as.character, on which paste in line 9 implicitly relies, at least in R version 2.12.2 (2011-02-25)? For example, use temp - apply(x,

Re: [Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-12 Thread Petr Savicky
On Thu, Mar 10, 2011 at 01:19:48AM -0800, Henrik Bengtsson wrote: It should be possible to run unique()/duplicated() column by column and incrementally update the set of unique/duplicated rows. This would avoid any coercing. The benefit should be even greater for data.frame():s. This is a

Re: [Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-10 Thread Petr Savicky
On Wed, Mar 09, 2011 at 02:11:49PM -0500, Simon Urbanek wrote: match() is a red herring here -- it is really a very specific thing that has to do with the fact that you're running unique() on a matrix. Also it's much easier to reproduce: x=c(1,1+0.2e-15) x [1] 1 1 sprintf(%a,x) [1]

Re: [Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-10 Thread Henrik Bengtsson
It should be possible to run unique()/duplicated() column by column and incrementally update the set of unique/duplicated rows. This would avoid any coercing. The benefit should be even greater for data.frame():s. My $.02 /Henrik On Thu, Mar 10, 2011 at 12:29 AM, Petr Savicky

[Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-10 Thread Terry Therneau
Simon pointed out that the issue I observed was due to internal behaviour of unique.matrix. I had looked carefully at the manual pages before posting the question and this was not mentioned. Perhaps an addition could be made? Terry T. __

[Rd] unique.matrix issue [Was: Anomaly with unique and match]

2011-03-09 Thread Simon Urbanek
match() is a red herring here -- it is really a very specific thing that has to do with the fact that you're running unique() on a matrix. Also it's much easier to reproduce: x=c(1,1+0.2e-15) x [1] 1 1 sprintf(%a,x) [1] 0x1p+0 0x1.1p+0 unique(x) [1] 1 1