[Rd] R crashes when setWinProgressBar is give a numeric value for label argument
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.
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.
R version 2.10.1 Patched (2010-02-08 r51108)
 LC_COLLATE=English_United States.1252
 LC_CTYPE=English_United States.1252
 LC_MONETARY=English_United States.1252
 LC_TIME=English_United States.1252
attached base packages:
 stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
Same thing happens in non-patched 2.10.1
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
More information about the R-devel