Re: [R] message: please select CRAN mirror

From: Ben Bolker <bbolker_at_gmail.com>
Date: Wed, 02 Mar 2011 19:05:05 +0000

Aggita <a.strelniece <at> eurotransplant.org> writes:

>
> > chooseCRANmirror()
> Error in m[, 1L] : incorrect number of dimensions
>
> Can someone explain me why I can't choose the cran mirror, but get again and
> again this error message. Have searched for this on several engines but
> can't find explanation.
>

  It's hard for us to diagnose this if we can't reproduce it.   I will take a shot though.

  The chooseCRANmirror function looks like this:

function (graphics = getOption("menu.graphics")) {

    if (!interactive())

        stop("cannot choose a CRAN mirror non-interactively")     m <- getCRANmirrors(all = FALSE, local.only = FALSE)     res <- menu(m[, 1L], graphics, "CRAN mirror")     if (res > 0L) {

        URL <- m[res, "URL"]
        repos <- getOption("repos")
        repos["CRAN"] <- gsub("/$", "", URL[1L])
        options(repos = repos)

    }
    invisible()
}

   Looking in the guts of the function, it is clear that it is failing when it looks at the list of mirrors that it has gotten -- this list of mirrors has somehow turned into a vector instead of a matrix.

   You could use debug(chooseCRANmirror) to step through the function and inspect the value of m just before the function crashes.

   This is probably the result of some sort of network problem -- you're not getting a decent list of mirrors. What is the result of

str(getCRANmirrors(all=FALSE,local.only=FALSE))

  ?



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 02 Mar 2011 - 19:09:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Mar 2011 - 09:10:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive