[R] R (external ?) reference

Henrik Bengtsson hb at maths.lth.se
Sat Mar 1 02:56:02 CET 2003


> -----Original Message-----
> From: r-help-admin at stat.math.ethz.ch 
> [mailto:r-help-admin at stat.math.ethz.ch] On Behalf Of Luke Tierney
> Sent: den 1 mars 2003 01:31
> To: Laurent Gautier
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] R (external ?) reference
> 
> 
> On Fri, 28 Feb 2003, Laurent Gautier wrote:
> 
> > Dear List,
> > 
> > I found a documentation on the web that mentions things like 'R 
> > references' (http://www.stat.uiowa.edu/~luke/R/simpleref.html).
> > 
> > However, I could not find the R_MakeReference and friends 
> in R... Does 
> > anyone knows more about that ?
> > 
> 
> It's not as clear as it could be in that document but that 
> part was just a proposal.  It has not been implemented.  
> Something at the pure R level along these lines can easily be 
> implemented with environments; something a bit more 
> sophisticated may eventually make it into the methods package.

For details on how environments can be used to implement/emulate
references using plain R code (as Luke suggest) see "Implementing
support for references in [R]"
(http://www.maths.lth.se/help/R/ImplementingReferences/). See especially
section 4.1 "Using an environment directly" and 4.2 "Encapsulating an
enviroment in a list or in an attribute", which points out the important
fact that you should wrap up your environment variable in a list to be
able to assign a (S3) class to it.

Cheers

Henrik Bengtsson
Lund University, Sweden
 
> luke
> 
> -- 
> Luke Tierney
> University of Iowa                  Phone:             319-335-3386
> Department of Statistics and        Fax:               319-335-3017
>    Actuarial Science
> 241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu




More information about the R-help mailing list