Re: [Rd] Table vs unique

2010-07-22 Thread Therneau, Terry M., Ph.D.
bject: Re: [Rd] Table vs unique On 07/21/2010 03:54 PM, Prof Brian Ripley wrote: > I believe this is a misdiagnosis: the 'rounding' is done by > as.character (as the help for argument 'levels' in ?factor does say) > and ?as.character has a full explanation (and is

Re: [Rd] Table vs unique

2010-07-22 Thread Göran Broström
On 07/21/2010 03:54 PM, Prof Brian Ripley wrote: I believe this is a misdiagnosis: the 'rounding' is done by as.character (as the help for argument 'levels' in ?factor does say) and ?as.character has a full explanation (and is linked from the relevant part of ?factor). as.numeric(as.character())

Re: [Rd] Table vs unique

2010-07-21 Thread Prof Brian Ripley
I believe this is a misdiagnosis: the 'rounding' is done by as.character (as the help for argument 'levels' in ?factor does say) and ?as.character has a full explanation (and is linked from the relevant part of ?factor). as.numeric(as.character()) should do the trick. On Wed, 21 Jul 2010, Ter

[Rd] Table vs unique

2010-07-21 Thread Terry Therneau
A bug in the survival routines was reported to me today. The root cause is a difference between table, unique, and sort. > temp <- rep(c(1, sqrt(2)^2, 2), 1:3) > unique(temp) [1] 1 2 2 > table(temp) temp 1 2 1 5 I'm using 2.10 on Linux, the user reported from 2.9 on Windows. 1. Minor issu