[R] bagplot - a rough R function

Peter Wolf pwolf at wiwi.uni-bielefeld.de
Thu Sep 22 12:07:02 CEST 2005


Martin Maechler wrote:
>>>>>>"Peter" == Peter Wolf <pwolf at wiwi.uni-bielefeld.de>
>>>>>>    on Wed, 21 Sep 2005 16:49:10 +0200 writes:
>>>>>>            
>
>    Peter> In the moment I am writing an R function for drawing
>    Peter> bagplots (two dimensional boxplots).
>    Peter> For some elements of the plot are found numerically
>    Peter> the resulting plots differs a little bit from the correct bagplots.
>
>    Peter> Here is the link to the actual version:
>
>    Peter> http://www.wiwi.uni-bielefeld.de/~wolf/software/R-wtools/bagplot/bagplot.R 
>    Peter> ( R code )
>
>    Peter> http://www.wiwi.uni-bielefeld.de/~wolf/software/R-wtools/bagplot/bagplot.pdf 
>    Peter> (examples and description)
>
>    Peter> Now I am looking for examples to test / to improve my function.
>    Peter> Where can I get data sets and the corresponding correct bagplots?
>
>I'll send you my (unpublished) version of my package 'bagplot'
>{{the one I've never released because of segmentation fault bugs
>  somewhere in Fortran}} in a private E-mail.
>
>In my version I had started make a function
>   bag() 
>which *computes* all the information needed and then returns an
>(S3) object "bag".  Then, the plotting happens via
>the 
>    plot.bag <- function(.....) {..........}
>method.
>
>So you can say
>
>   plot(bag(.........), ........)
>
>if you want both (computing and plotting) at once, but can also
>separate the two --- following very much the modern "S" way
>"whole object ..".
>
>
>Martin
>
>  
Hello Martin,

you are right. Separating computing and plotting is a better way for
a public version and I think that I will split my function. But
during testing algorithmic problems it is nice to have only one function.

Peter




More information about the R-help mailing list