[R-SIG-Mac] contrib.url on OSX ?!

Seth Falcon sfalcon at fhcrc.org
Wed Nov 30 18:54:22 CET 2005


On 30 Nov 2005, sdavis2 at mail.nih.gov wrote:
> I'll try reinstalling at some point here.  I tend to install from
> source, so that may be an issue.

Perhaps someone on the r-sig-mac list will have some insight.  I
tested using both an R 2.2 binary install and an R 2.3 from source
install on OS X and I get the bin/macosx/powerpc/contrib/2.x behavior
so I don't know what is going on.

If you are in a hurry, you could redefine contrib.url.  Here is what I
have:

contrib.url <-
function (repos, type = getOption("pkgType")) 
{
    if (is.null(repos)) 
        return(NULL)
    if ("@CRAN@" %in% repos && interactive()) {
        cat(gettext("--- Please select a CRAN mirror for use in this session ---\n"))        flush.console()
        chooseCRANmirror()
        m <- match("@CRAN@", repos)
        nm <- names(repos)
        repos[m] <- getOption("repos")["CRAN"]
        if (is.null(nm)) 
            nm <- rep("", length(repos))
        nm[m] <- "CRAN"
        names(repos) <- nm
    }
    if ("@CRAN@" %in% repos) 
        stop("trying to use CRAN without setting a mirror")
    ver <- paste(R.version$major, strsplit(R.version$minor, ".", 
        fixed = TRUE)[[1]][1], sep = ".")
    res <- switch(type, source = paste(gsub("/$", "", repos), 
        "src", "contrib", sep = "/"), mac.binary = paste(gsub("/$", 
        "", repos), "bin", "macosx", R.version$arch, "contrib", 
        ver, sep = "/"), win.binary = paste(gsub("/$", "", repos), 
        "bin", "windows", "contrib", ver, sep = "/"))
    res
}

+ seth



More information about the R-SIG-Mac mailing list