Re: [R] message: please select CRAN mirror

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

Aggita <a.strelniece <at>> 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("")) {

    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)


   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


  ? mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive