[R-SIG-Mac] Install multiple versions of R on Mac

Simon Urbanek simon.urbanek at r-project.org
Tue Aug 16 09:15:03 CEST 2011


On Aug 15, 2011, at 7:24 PM, Steven McKinney wrote:

> Hi Marius,
> 
> What I have found is that RSwitch does not work if you only have one instance of R.app in
> your Applications folder.  RSwitch does not modify R.app in the Applications folder, so after
> you switched back to R-2.13.? with RSwitch, the R-2.13 startup is interacting with the
> R-2.14 R.app in some fashion that Simon Urbanek might be able to explain but which I
> have not yet worked out.
> 

R.app is always tied to a particular R version, because it's compiled against R (the path to libR.dylib contains the version). So you can only use R.app with the version of R it was compiled against. RSwitch only makes one of the other frameworks "Current", it has no effect on the R.apps on your machine.

As Steven pointed out you have to move/copy your R.app/R64.app out of the way to keep them separate for each R version. Alternatively you can also download them separately from the R.research.att.com pages. It doesn't matter how you name them or where you put them. The installation process will keep your old R.apps if they are not in Applications (which is not standard on Mac OS X but very useful for having multiple R versions).

Cheers,
Simon


> When I needed both R-2.12.2 and R-2.13.1, I made a folder
> called "temp" in Applications, then copied the R.app from R-GUI-5732-2.12-leopard_Leopard64.dmg 
> to Applications/temp and renamed it R-2.12.2_64bit.app, then moved that to the
> Applications folder.  Next I copied the R.app from R-GUI-5885-2.13-leopard-Leopard64.dmg
> to Applications/temp, renamed it to R-2.13.1_64bit.app, then moved it to the Applications
> folder.  Now after I use RSwitch, if I run the appropriate R-<version>.app the Mac R GUI
> initialization and startup works.  See e.g. 
> 
> http://www.mail-archive.com/r-sig-mac@r-project.org/msg00559.html
> 
> R-GUI-5732-2.12-leopard_Leopard64.dmg and the like available from 
> http://r.research.att.com/
> 
> Your R.app in the Applications directory is the one from the last R you installed,
> which appears to be the current development version.  So rename R.app to
> something such as R-2.14.0_devel_64bit.app.  Then reinstall R-2.13.1 or use the strategy
> I outlined above, and get the R-2.13.1 R.app renamed to R-2.13.1_64bit.app
> 
> Then after you use RSwitch, run the appropriate R-<version>.app
> 
> 
> HTH 
> 
> Steven McKinney
> ________________________________________
> From: r-sig-mac-bounces at r-project.org [r-sig-mac-bounces at r-project.org] On Behalf Of Marius Hofert [m_hofert at web.de]
> Sent: August 15, 2011 6:35 AM
> To: Help R
> Subject: [R-SIG-Mac] Install multiple versions of R on Mac
> 
> Dear expeRts,
> 
> I would like to run R 2.13 and R 2.14 on a MacBook Pro (2.53 GHz Intel Core 2 Duo, 4 GB 1067 MHz DDR3) with Mac OS X 10.6.8. I installed Rswitch to switch between the two versions. On installing the second version (2.14), I executed
> sudo pkgutil --forget org.r-project.R.Leopard.fw.pkg
> in the Terminal as suggested on the installation process. Then I finished the installation. 2.14 runs great (64-bit), but when I switch to R 2.13 and start R, I get the output below.
> 
> What did I do wrong?
> 
> Note: I previously had only R 2.14 running. Then I installed R 2.13 (because some things are not available for 2.14). On the installation I missed the fact that R 2.14 is not available anymore [I missed the note on using pkgutil...], so I only had R 2.13 (also running fine). After that I downloaded R 2.14 and executed the pkgutil command during the installation process. I'm not sure if this matters (I guess not, since that's probably the more typical way [first having 2.13 installed and then 2.14 :-)]).
> 
> Cheers,
> 
> Marius
> 
> 
> *** caught segfault ***
> address 0x54d8, cause 'memory not mapped'
> 
> Traceback:
> 1: .Call("R_initMethodDispatch", as.environment(where), PACKAGE = "methods")
> 2: initMethodDispatch(where)
> 3: ..First.lib(libname, pkgName, env)
> 4: fun(...)
> 5: doTryCatch(return(expr), name, parentenv, handler)
> 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 7: tryCatchList(expr, classes, parentenv, handlers)
> 8: tryCatch(fun(...), error = identity)
> 9: runHook(".onLoad", package, env, package.lib, package)
> 10: loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source)
> 11: doTryCatch(return(expr), name, parentenv, handler)
> 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 13: tryCatchList(expr, classes, parentenv, handlers)
> 14: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste(prefix, "\n  ", sep = "")    }    else prefix <- "Error : "    msg <- paste(prefix, conditionMessage(e), "\n", sep = "")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error"))})
> 15: try({    ns <- loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source)    dataPath <- file.path(which.lib.loc, package, "data")    env <- attachNamespace(ns, pos = pos, dataPath = dataPath,         deps)})
> 16: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,     warn.conflicts = warn.conflicts, quietly = quietly, keep.source = keep.source)
> 17: doTryCatch(return(expr), name, parentenv, handler)
> 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 19: tryCatchList(expr, classes, parentenv, handlers)
> 20: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE,     logical.return = TRUE, warn.conflicts = warn.conflicts, quietly = quietly,     keep.source = keep.source), error = function(e) e)
> 21: require("methods", quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
> 22: .OptRequireMethods()
> 
> Possible actions:
> 1: abort (with core dump, if enabled)
> 2: normal R exit
> 3: exit R without saving workspace
> 4: exit R saving workspace
> Selection:
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> 



More information about the R-SIG-Mac mailing list