From chrishold at psyctc.org  Wed Jan  6 21:10:10 2010
From: chrishold at psyctc.org (chrishold at psyctc.org)
Date: Wed,  6 Jan 2010 21:10:10 +0100 (CET)
Subject: [Rd] chooseCRANmirror() (PR#14179)
Message-ID: <20100106201010.2D5D0282BE89@mail.pubhealth.ku.dk>

Full_Name: Chris Evans
Version: 2.10.1
OS: Windows XP sp3
Submission from: (NULL) (86.159.235.204)


I was on leave and using a wifi internet connection in France and got connected,
launched R (2.10.1 on Windoze XPsp3) and tried to update my packages and got:

> chooseCRANmirror()
Error in m[, 1L] : incorrect number of dimensions

It took me a bit to realise that the message was coming up because the wifi
connection had dropped.  I know it's a small issue but is it possible to produce
a more informative error message. I can see a bodge of changing chooseCRANmirror
to:

function (graphics = getOption("menu.graphics")) 
{
    if (!interactive()) 
        stop("cannot choose a CRAN mirror non-interactively")
    m <- getCRANmirrors(all = FALSE, local.only = FALSE)
    ### bodge added here
    if (ncol(m) != 8) stop("There was a problem with access to CRAN mirrors,
please check your internet connection")
    ### end of bodge
    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()
}
<environment: namespace:utils>

However, I'm sure you code gurus can do much better than that.

Many thanks for R: statistical wonderland, coding genius and a social movement
of which to be hugely proud!

Chris (Evans)



[Rd] chooseCRANmirror() (PR#14179)
chrishold at psyctc.org