[RsR] function naming for "robust ..."

Martin Maechler maechler at stat.math.ethz.ch
Fri Jan 20 22:38:51 CET 2006

>>>>> "Claudio" == Claudio Agostinelli <claudio at unive.it>
>>>>>     on Fri, 20 Jan 2006 12:50:43 +0100 (CET) writes:

    Claudio> Ciao Martin, I would like, progressively,
    Claudio> standardize my package 'wle' with the standard of
    Claudio> robustbase. If think, for me, the easy way is to
    Claudio> start with lm function (since you (you, matias and
    Claudio> andreas) are working on roblm).

and robglm() / glmrob()  {taking up Werner's naming suggestion
which I find very worth of consideration -- other takers, please.. ?}

    Claudio> Are you thinking of a mechanism, like roblm(*,
    Claudio> method="MM"), in this case there are any way for R
    Claudio> to register "method" from other package once
    Claudio> loaded, so that, for instance, we can have,
    Claudio> automatically, roblm(*, method="WL") for my
    Claudio> function? i.e., for the final user:

    >> library(robustbase)
    >> roblm(*, method="WL") Error: method "WL" for "roblm" not found
    >> library(wle) # new version of the library
    >> roblm(*, method="WL") # now it works

    Claudio> Otherwise, what kind of convention should I use for the name:
    Claudio> roblmwle
    Claudio> robwlelm

Thank you for the interesting and very relevant question!

Indeed, "robustbase" itself should not contain all possible
methods, but rather just the 'base', and particular we had
agreed for the time being to focus on the methodology of the MMY

OTOH, it makes very much sense to allow and encourage
``plugins'' from other packages {that will have a 'Depends: robustbase'}.

    Claudio> This is a potential problem for extending the functions to any other new method 
    Claudio> available in the future. What is your suggestion?

well I hope we will converge some time in the future on how to
do robust linear regression .. :-) {well for  p > n, we probably
still have slack ...}
In any case, I think it's a very good idea to allow for
plugins, and I also agree that we should do this by a naming

In some cases, we (the community of S programmers) have used the
convention to call the plugin for method <Meth> to function
<Func>  " <Func>.<Meth> "  where I think we should nowadays most
probably use  <Func>_<Meth>
this would give  lmrob_wle() or roblm_wle()  for your plugin
But note that we will not only have to agree on the naming
scheme, but also on exactly what arguments the function must
accept (it can have further optional ones) and what exactly its
return value has to look like.
But I think it's too early to get into these details already


More information about the R-SIG-Robust mailing list