Re: [Rd] S4 accessors (corrected)

From: Ross Boylan <ross_at_biostat.ucsf.edu>
Date: Tue 26 Sep 2006 - 00:23:38 GMT

On Tue, 2006-09-26 at 00:20 +0000, Ross Boylan wrote:
> I have a small S4 class for which I've written a page grouping many of
> the accessors and replacement functions together. I would be interested
> in people comments on the approach I've taken.
>
> The code has a couple of decisions for which I could imagine
> alternatives. First, even simple get/set operations on class elements
> are wrapped in functions. I suppose I could just use myinstance@slot to
> do some of these operations, though that is considered bad style in more
> traditional OO contexts.
>
> Second, even though the functions are tied to the class, I've defined
> them as free functions rather than methods. I suppose I could create a
> generic that would reject most arguments, and then make methods
> appropriately.
>
> For the documentation, I've created a single page that groups many of
> the functions together. This is a bit awkward, since the return values
> are

NOT
> necessarily the same. Things are worse for replacement functions;
> as I understand it, they must use "value" for their final argument, but
> the value has different meanings and types in different contexts.
>
> Any suggestions or comments?
>
> I've attached the .Rd file in case more specifics would help.

Sorry!



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Sep 26 11:54:29 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 26 Sep 2006 - 02:30:11 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.