[R-SIG-Mac] Tiny bug for chooseCRANmirror(graphics=TRUE) using a GUI list [select.list() issue]

Hans-Joerg Bibiko bibiko at eva.mpg.de
Wed Apr 30 15:55:23 CEST 2008


Hi,

there is a very tiny bug if I invoke chooseCRANmirror(graphics=TRUE).
If I press 'Cancel' the following error message will be prompted:

Error in if (res > 0) { : argument is of length zero

due to the fact that the GUI function for 'menu' returns 'integer(0)'  
for canceling.
[Actually caused by select.list(). It returns character(0) and  
'match(character(0), c("a","b"), nomatch = 0)' returns integer(0)]

One could either write in the chooseCRANmirror function instead of:

if (res > 0) {

this:

if (length(res) && res>0) {


or change select.list() in such a way that it returns 0 for canceling,  
what should be the best way, I mean. The function 'menu' invoked by  
graphics=FALSE will be also canceled by typing 0.

This shouldn't interfere with other OSs. (On Windows it works)

MacOS 10.5.2 ppc; R 2.6.2 and R 2.7.0

Best,

--Hans



More information about the R-SIG-Mac mailing list