[R] bagplot()

Martin Maechler maechler at stat.math.ethz.ch
Fri Sep 17 18:39:33 CEST 2004


>>>>> "BDR" == Prof Brian Ripley <ripley at stats.ox.ac.uk>
>>>>>     on Mon, 13 Sep 2004 16:49:31 +0100 (BST) writes:

    BDR> There is no bagplot function in S-PLUS.
    BDR> There is one by Rousseeuw et al for S at

    BDR> http://www.agoras.ua.ac.be/Locdept.htm

    BDR> and a reply in the archives about the problems of porting at:

    BDR> http://maths.newcastle.edu.au/~rking/R/help/03b/4916.html

    BDR> My guess is that like several other cases, R porting
    BDR> has exposed bugs in the original code.

Indeed!
as mentioned in the r-help message in the above link,
Christian Keller had spent some time in porting it, and I had
(spent more time!) in try to modularize (separate computation
from plotting) and other enhancements.

This lead to more extensive testing that AFAIR revealed
quite problematic bugs (hidden in Fortran) that I never got
around to diagnose or fix.

E.g.,

 x0 <- c(1, 5,  6,  6,   6,  6,  6, 7, 7,  8, 11,  13)
 y0 <- c(2, 3.5,4,  4.5, 4.5,5,  5, 5, 5,  5.5,5.5, 7)

 r <- bagplot(x0,y0, ident=FALSE)
 ## gives

 ## [1] The coordinates of the Tukey median are ( 6.75 , 4.875 ).
 ## [1] "The bag is only plotted when there are at least 15 observations."
 
 ## and a 'spider' (instead of a bag) since it there only 12 observations.
 ## This is as desired.

but repeating the bagplot() call twice (hence, doing it three times)
leads to a segmentation fault, both in S-plus 6.2 with the
original code and in R ("all versions") with my improved code.


    BDR> On Mon, 13 Sep 2004, Matthew David Sylvester wrote:

    >> I saw a little discussion about this in the archives, but it was unclear
    >> to me whether someone had submitted a port to R of the Splus bagplot()
    >> function.  If so, does anyone know where I could get it?  Thanks.




More information about the R-help mailing list