[Rd] R crashes when setWinProgressBar is give a numeric value for label argument

Greg Snow Greg.Snow at imail.org
Wed Feb 10 20:59:47 CET 2010


This problem can be seen by the following commands:

> pb <- winProgressBar(max=1000, label='0')
> b <- 1
> setWinProgressBar(pb, b, label=b)

This set of commands (on windows of course, XP in this case) causes R to crash.

This is not strictly a bug since the documentation states that the label argument should be a character string and using as.character(b) does work properly.  But when I (and possibly others) forget this and use something like the above, having the whole R process crash seems a bit extreme.

Possible responses:

1. ignore this and hope that after being punished for not remembering the correct syntax enough times I will eventually learn to do the correct thing.

2. add a check and generate an error if title or lab is not a character string (less severe punishment, I may learn eventually, but maybe not as quick).

3. add label <- as.character(label) and same idea for title, so that the above code works without the user needing to remember the as.character.  This may need a check for NULL values as well.

4.  Something else that I have not thought of.

Number 1 would be easiest for R core, hardest on me.  Numbers 2 and 3 have the potential drawback of slowing things down slightly.

My sessionInfo()

> sessionInfo()
R version 2.10.1 Patched (2010-02-08 r51108) 
i386-pc-mingw32 

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_2.10.1
>

Same thing happens in non-patched 2.10.1

Thanks,



-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111



More information about the R-devel mailing list