From ggrothendieck at gmail.com  Tue Apr  5 18:25:19 2011
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Tue, 5 Apr 2011 12:25:19 -0400
Subject: [Rd] Names of a data set in a package
In-Reply-To: <4D9B2C92.4000707@stat.umu.se>
References: <4D9B2C92.4000707@stat.umu.se>
Message-ID: <BANLkTimfM4V4X=F2xgSs2VskdhrMmGQjPQ@mail.gmail.com>

2011/4/5 G?ran Brostr?m <gb at stat.umu.se>:
> For some reason I want to let one data set in a package be known under two
> different names. ?Is that possible, and if so, how? I do not want to have
> two copies of the data set in the package.
>

This will allow you to read the data frame under a different name but
you won't be able to modify it under the different name.  We make use
of the built in data frame BOD and create the alternate name BOD2:

> makeActiveBinding("BOD2", function() BOD, .GlobalEnv)
> BOD$Time
[1] 1 2 3 4 5 7
> BOD2$Time
[1] 1 2 3 4 5 7
> # changing BOD also changes BOD2
> BOD$Time[1] <- 99
> BOD2$Time
[1] 99  2  3  4  5  7


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



[Rd] Names of a data set in a package
Gabor Grothendieck