Skip to content
Back to formatted view

Raw Message

Message-ID: <CAP01uR=NH-nqWDAt3UxYc6brKtmyiHmKVxQLKsAT9QAu7jHe7Q@mail.gmail.com>
Date: 2012-10-02T20:53:27Z
From: Gabor Grothendieck
Subject: Having two different versions of a package in the same R installation
In-Reply-To: <7E8037094A0C2146AA3E6F94DAE621C344452E19@AD-EXCHMBX2-1.aau.dk>

On Tue, Oct 2, 2012 at 4:18 PM, S?ren H?jsgaard <sorenh at math.aau.dk> wrote:
> Dear list,
>
> I am making some comparisons of two versions of the lme4 package: The CRAN version and the R-Forge version. For the moment I have two different R installations, each with a different version of lme4. However it would be convenient if I could have the same version within the same R installation such that I can run a code chunk on one lme4 version and immediately after run the same code chunk on another lme4 version. Does anyone know if this is possible?
>

Install the two versions into two different R libraries:

install.packages("my.package", repos = ..., lib = ...) # 1st repo/lib
install.packages("my.package", repos = ..., lib = ...) # 2nd repo/lib

library(my.package, lib.loc = ...) # 1st lib
# use it
detach(my.package, unload = TRUE)
# next line may or may not be needed
library.dynam.unload("my.package", system.file(package = "my.package"))
library(my.package, lib.loc = ...) # 2nd lib

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com