[R] robustbase problem [bug?] in adjbox function.

Peter Ehlers ehlers at ucalgary.ca
Wed Dec 8 14:58:34 CET 2010

On 2010-12-07 12:01, kv wrote:
> hello list,
> i'm a bit puzzled by the error message i get when i copy past this in R:
> data<-c(16,13,17,4,15,24,59,18,33,8,42,19,20,4,11,9,3,7,10,3,3,67,4,4,13,16,6,3,3,6,3,4,35,10,16,11,24,7,47,8,8,2,12,3,8,4,3,6,6,10,2,9,3,15,21,13,8,16,2,5,14,9,21,4,9,11,36,4,8,4,6,4,10,13,11,5,4,16,14,3,22,20,5,2,8,12,14,27,2,13,8,18,18,6,31,3,14,23,13,27,13,6,7,10,12,3,17,30,3,13,13,9,29,4,4,18,7,23,4,20,3,9,4,4,3,3,5,32,11,3,4,5,10,12,7,4,13,10,11,37,6,8,6,3,12,8,10,6,12,7,8,9,5,6,12,5,4,24,7,2,9,2,4,3,8,5,10,5,4,4,7,4,7,7,4,16,4,3,12,4,3,10,27,4,14,7,10,4,9,8,3,5,3,8,5,2,8,38,3,3,3,4);
> plot(x=c(1,2),y=rep(1,2),ylim=range(data),xlim=c(0.5,2.5),type="n",main=c("Adjusted
> boxplot vs. Classical boxplot"),ylab=c("Loss Data"),xlab=c(""),axes=F)
> adjbox(x=datac,pars=list(outpch=16,outcex=2,outcol="light
> blue"),add=T,at=1,col="light blue")
> boxplot(x=datac,pars=list(outpch=16,outcex=2,outcol="light
> green"),add=T,at=2,col="light green")
> axis(2,at=seq(0,max(data)+10,by=10),col="orange",labels=F)
> axis(1,at=c(1,2),col="orange",labels=c("Adjusted boxplot","Classical
> boxplot"))
> in my computer adjbox says:
> "maximal number of iterations (100 =? 100) reached prematurely
> Error in mc.default(x, na.rm = TRUE) :
>    mc(): not 'converged' in 100 iterations"

You're not exactly providing a 'minimal' example. (We don't need
to know your colour preferences and plot titles, etc, since
those have no relation to the problem.)

The problem is with mc() which adjbox() calls (as is stated
on the help page for adjbox).

I suspect that there may indeed be a bug in the C code called
by mc(), possibly related to ties. I saw no comments about
ties on the help page for mc().

A workaround for you might be to add a very small disturbance
to your data, e.g. rnorm(length(datac), sd = 1e-10).

Note to the maintainer:
Here's a slightly simpler reproducible example:

x <- sort(sample(67, 101, TRUE))
# maximal number of iterations (100 =? 100) reached prematurely
# Error in mc.default(x) : mc(): not 'converged' in 100 iterations

Eliminating any one of the elements of x with index in
c(17:18, 33:45, 48:50) results in convergence.

Peter Ehlers

> R2.12 and the latest version of robustbase -in ubuntu 10.10).

More information about the R-help mailing list