Skip to content
Prev 68382 / 398506 Next

Problem with R-2.1.0: install.packages() doesn't work

On Fri, 2005-04-22 at 18:00 -0400, Manuel Morales wrote:
Ok. So that suggests a problem with capabilities(tcltk) == FALSE, which
will be the result of not having the tcl/tk devel RPMS installed.

To Peter's prior post, my read of the code for menu() suggests that
there is a problem in the conditional code:
function (choices, graphics = FALSE, title = "")
...

The code check there is:

    if (graphics) {
        if (.Platform$OS.type == "windows" || .Platform$GUI ==
            "AQUA") {
            res <- select.list(choices, multiple = FALSE, title = title)
            return(match(res, choices, nomatch = 0))
        }
        else if (.Platform$OS.type == "unix" && capabilities("tcltk") &&
            capabilities("X11"))
            res <- tcltk::tk_select.list(choices, multiple = FALSE,
                title = title)
        return(match(res, choices, nomatch = 0))
    }


If my read is correct, it looks like there might be a missing brace pair
for the 'else if' part?

Shouldn't that section read:

   if (graphics) {
        if (.Platform$OS.type == "windows" || .Platform$GUI ==
            "AQUA") {
            res <- select.list(choices, multiple = FALSE, title = title)
            return(match(res, choices, nomatch = 0))
        }
        else if (.Platform$OS.type == "unix" && capabilities("tcltk") &&
            capabilities("X11")) { # <<<<<< NOTE OPEN BRACE HERE >>>>>>
            res <- tcltk::tk_select.list(choices, multiple = FALSE,
                title = title)
            return(match(res, choices, nomatch = 0))
        } # <<<<<< NOTE CLOSE BRACE HERE >>>>>
    }


Without the braces, it will get to:

 return(match(res, choices, nomatch = 0))

whether all of the checks are TRUE or not, the latter being the case at
least for Manuel.


HTH,

Marc Schwartz