From therneau at mayo.edu  Thu Mar  5 02:15:53 2009
From: therneau at mayo.edu (Terry Therneau)
Date: Wed, 4 Mar 2009 19:15:53 -0600 (CST)
Subject: [Rd] methods package
Message-ID: <200903050115.n251Frjs006726@yacko.mayo.edu>

  I'm working on the next version of coxme, one step of which is converting
the bdsmatrix library from Splus to R.  Actually, it is a conversion from
S4 methods as first described in the Green book to S4 methods as they 
currently exist.  Mostly it's going ok, but not entirely.

  1. The biggest issue is lack of documentation.  The online help pages have
not been a help; they keep saying it's "as found in the green book - almost".
I've looked for the package on CRAN in the hopes for more there, but can't
find it.  Perchance there is something obvious that I am missing?

  2. The changes are small but numerous.  The current one that has me puzzled
is a method for addition:
   setMethod(Ops, signature=c('numeric', 'bdsmatrix'), ....

Let xmat be ordinary and bmat be a bdsmatrix.  In the old code "xmat + bmat"
fell to this method (which knows what to do), in the current R I get
failure due to no method found.  is.numeric(xmat) is TRUE.
   What is the fix?

 3. In the green book the examples used .Dim and .Dimnames slots, the Matrix
library uses Dim and Dimnames.  Is there a good reason to choose one or the
other?

  I'll be out of town for the next few days (son's wedding) so instant response
is not necessary.

	Terry Therneau



[Rd] methods package
Terry Therneau