[Rd] Constructor blah() vs. as.blah()

jhallman at frb.gov jhallman at frb.gov
Fri Aug 15 18:34:26 CEST 2008


When should we use one versus the other?  If I'm designing an S3 class
"blah", should I just implement

blah <- function(x, ...) UseMethod("blah")

and then a bunch of blah.whatever() functions, including blah.default()?
Or should I do

as.blah <- function(x, ...) UseMethod("as.blah")

with a bunch of methods for it?  Or do both?  

Jeff



More information about the R-devel mailing list