ct.
>>
>
> It would be nice to have a list of such things ... I suspect they depend
> more heavily on the value of 'you' than the class.
>
>
> Bill Dunlap
>> Spotfire, TIBCO Software
>> wdunlap tibco.com
>>
>> -Original Messag
d more heavily on the value of 'you' than the class.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-----Original Message-
From: r-devel-boun...@r-project.org
[mailto:r-devel-boun...@r-project.org] On Behalf Of Dan Murphy
Sent: Monday, January 23, 2012 10:31 PM
To:
vel-boun...@r-project.org] On
Behalf Of Dan Murphy
Sent: Monday, January 23, 2012 10:31 PM
To: peter dalgaard
Cc: r-devel@r-project.org
Subject: Re: [Rd] factor S4 class is NA when as.character method exists
Thank you for your reply, Peter. But that didn't work either. Continui
or a new class in order to make it
do the "basic" things you expect.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On
> Behalf Of Dan Murphy
> Sent: Monday
Thank you for your reply, Peter. But that didn't work either. Continuing
the example:
setGeneric("unique")
setMethod("unique", "foo", function(x, incomparables = FALSE, ...){
y <- callNextMethod(x = getDataPart(x), incomparables = incomparables,
...)
new("foo", y)
})
> unique(bar)
On Jan 23, 2012, at 16:07 , Dan Murphy wrote:
> Hello,
>
> 'factor' returns for my S4 object when the class is given an
> "as.character" method. Here is a minimal example:
>
>> setClass("foo", contains="numeric")
>> bar <- new("foo", 12)
>> factor(bar)
> [1] 12
> Levels: 12
>> setMethod("as.ch