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

From: <jhallman_at_frb.gov>
Date: Fri, 15 Aug 2008 12:34:26 -0400

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?


R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 15 Aug 2008 - 19:29:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 16 Aug 2008 - 01:36:52 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive