Skip to content
Back to formatted view

Raw Message

Message-ID: <6.0.1.1.2.20040116145120.0217fe18@stat4ux.stat.ucl.ac.be>
Date: 2004-01-16T13:53:25Z
From: Eric Lecoutre
Subject: reference to objects
In-Reply-To: <Pine.LNX.4.58.0401161344050.2592@bayes.speech.kth.se>

Hi,

You will find some pieces of information about the way to handle such 
things at:
http://www.maths.lth.se/help/R/
Programming with references

Note that you will have to download and install the package developped by 
the author, Henrik Bengtsson

HTH,

Eric


At 14:22 16/01/2004, Giampiero Salvi wrote:
>Hi,
>is there a way to reference to a data object without copying it?
>
>For example I have a huge matrix called dist and I want two objects
>obj1 and obj2 to have a memeber dist that points to the matrix, but
>I don't want, for memory reasons, to copy the matrix twice.
>
>As far as I understand the following code will generate three copies
>of my data:
>
>dist <- some_code_that_generates_data
>obj1$dist <- dist
>obj2$dist <- dist
>
>Thank you!
>Giampiero



--------------------------------------------------
L'erreur est certes humaine, mais un vrai d?sastre
n?cessite un ou deux ordinateurs. Citation anonyme
--------------------------------------------------
Eric Lecoutre
Informaticien/Statisticien
Institut de Statistique / UCL

TEL (+32)(0)10473050       lecoutre at stat.ucl.ac.be
URL http://www.stat.ucl.ac.be/ISpersonnel/lecoutre