Re: [Rd] factor S4 class is NA when as.character method exists

2012-01-25 Thread Dan Murphy
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

Re: [Rd] factor S4 class is NA when as.character method exists

2012-01-24 Thread John Chambers
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:

Re: [Rd] factor S4 class is NA when as.character method exists

2012-01-24 Thread Prof Brian Ripley
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

Re: [Rd] factor S4 class is NA when as.character method exists

2012-01-24 Thread William Dunlap
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

Re: [Rd] factor S4 class is NA when as.character method exists

2012-01-23 Thread Dan Murphy
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)

Re: [Rd] factor S4 class is NA when as.character method exists

2012-01-23 Thread peter dalgaard
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