[Rd] chooseCRANmirror() (PR#14179)

From: <chrishold_at_psyctc.org>
Date: Wed, 06 Jan 2010 21:10:10 +0100 (CET)


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)



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 07 Jan 2010 - 12:35:54 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 Thu 07 Jan 2010 - 15:20:12 GMT.

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

list of date sections of archive