[Rd] user interface and documentation of setIs and setAs, some suggestions (S4).

From: Witold Eryk Wolski <wolski_at_molgen.mpg.de>
Date: Fri 08 Oct 2004 - 23:18:45 EST

By reading the documentation for _setIs_ I noted that for the same object three different names are used.

  1. the name of the first argument in the functions coerce and replace in setIs must be _obj_ (see example section or) setIs("MVCa","list",coerce=function(obj){obj@list},replace=function(obj,value){obj@list<-value})
  2. At the same time in the usage section: setIs(class1, class2, test=NULL, coerce=NULL, replace=NULL, by = character(), where = topenv(parent.frame()), classDef =, extensionObject = NULL, doComplete = TRUE)
  3. and finally in the argument section: the object to 'class2', and to alter the object so that 'is(object, class2)' is identical to 'value'.

I much more like how setAs is implemented, we cast _from_ _to_ and so the arguments in all this functions are named. Its much more consistent.

I would also suggest to replace the keyword _def_ in the setAs function by _coerce_ as it is in the setIs function. I thinke it will be nicer if bot methods will have a unified user interface if possible. Of corse it may be that this is not possible for reasons not known to me. In this case sorry.


Dipl. bio-chem. Witold Eryk Wolski         
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin                 _
tel: 0049-30-83875219                 __("<   'v'
http://www.molgen.mpg.de/~wolski      \__/   /   \
mail: witek96@users.sourceforge.net    ^^     w w

R-devel@stat.math.ethz.ch mailing list
Received on Fri Oct 08 23:29:29 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:20 EST