[Rd] "Default" accessor in S4 classes

Chris Jewell chris.jewell at warwick.ac.uk
Wed Jan 9 01:28:49 CET 2013


Okay, thanks for the input, All.  I'd settled on the explicit coercion as.data.frame as well as the myObject[] syntax which makes a lot of sense.  I'd also like to implement an as.double() method.  However, I'm having trouble embedding this into my package.  In the R file I have:

setMethod("as.double", "HD5Proxy", function(x) as.double(x[]))

and exportMethods(as.double) in my NAMESPACES file.  However, on checking the package, I get an error saying that method "as.double" cannot be found.  I noticed that the setMethod command actually returns a character vector with "as.numeric", so I'm assuming this is the problem.  How do I explicitly export my as.double method?

Thanks,

Chris



More information about the R-devel mailing list