On 10 Nov 2003, Rajarshi Guha wrote:> Hi, > is the following possible - in a given session I make a lot of objects > and save when exiting. Usually I note down seperately what each object > is about. Is it possible to attach data to any object which would > essentially be a short note explaining the meaning of it? > > Thanks,Rajarshi, the following does what you want. I don't know whether its generally a good idea to do the documentation of your data this way.> X <- data.frame(x=1:10,y=1:0)> Xy x 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10> attr(X,"note") <- " Rajarshi's dummy data"> Xx y 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10> attr(X,"note")[1] " Rajarshi's dummy data" -- Uli Flenker Institute of Biochemistry German Sport University Cologne Carl-Diem-Weg 6 50933 Cologne Phone 0049/221/4982-506
Hi, is the following possible - in a given session I make a lot of objects and save when exiting. Usually I note down seperately what each object is about. Is it possible to attach data to any object which would essentially be a short note explaining the meaning of it? Thanks, ------------------------------------------------------------------- Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE ------------------------------------------------------------------- The Heineken Uncertainty Principle: You can never be sure how many beers you had last night.
See ?comment for a built-in method using S3 class attributes.> -----Original Message----- > From: Rajarshi Guha [mailto:rxg218 at psu.edu] > Sent: 10 November 2003 16:15 > To: R > Subject: [R] attaching data to any object > > > Security Warning: > If you are not sure an attachment is safe to open please contact > Andy on x234. There are 0 attachments with this message. > ________________________________________________________________ > > Hi, > is the following possible - in a given session I make a lot > of objects > and save when exiting. Usually I note down seperately what each object > is about. Is it possible to attach data to any object which would > essentially be a short note explaining the meaning of it? > > Thanks, > > ------------------------------------------------------------------- > Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> > GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE > ------------------------------------------------------------------- > The Heineken Uncertainty Principle: > You can never be sure how many beers you had last night. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >Simon Fear Senior Statistician Syne qua non Ltd Tel: +44 (0) 1379 644449 Fax: +44 (0) 1379 644445 email: Simon.Fear at synequanon.com web: http://www.synequanon.com Number of attachments included with this message: 0 This message (and any associated files) is confidential and\...{{dropped}}
Rajarshi Guha wrote:> Hi, > is the following possible - in a given session I make a lot of objects > and save when exiting. Usually I note down seperately what each object > is about. Is it possible to attach data to any object which would > essentially be a short note explaining the meaning of it?You can add an attribute as in: x <- 1:10 attributes(x) <- list(my.note = "This is a test") but I think it is not really what you are going to do... Uwe Ligges> Thanks, > > ------------------------------------------------------------------- > Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> > GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE > ------------------------------------------------------------------- > The Heineken Uncertainty Principle: > You can never be sure how many beers you had last night. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Mon, 2003-11-10 at 11:32, Uwe Ligges wrote:> Rajarshi Guha wrote: > > > Hi, > > is the following possible - in a given session I make a lot of objects > > and save when exiting. Usually I note down seperately what each object > > is about. Is it possible to attach data to any object which would > > essentially be a short note explaining the meaning of it? > > You can add an attribute as in: > > x <- 1:10 > attributes(x) <- list(my.note = "This is a test") > > but I think it is not really what you are going to do...The comment function does what I wanted ------------------------------------------------------------------- Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE ------------------------------------------------------------------- A meeting is an event at which the minutes are kept and the hours are lost.
On 10 Nov 2003 at 11:14, Rajarshi Guha wrote: The library Hmisc has a function comment() doing this. Kjetil Halvorsen> Hi, > is the following possible - in a given session I make a lot of objects > and save when exiting. Usually I note down seperately what each object > is about. Is it possible to attach data to any object which would > essentially be a short note explaining the meaning of it? > > Thanks, > > ------------------------------------------------------------------- > Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net> > GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE > ------------------------------------------------------------------- > The Heineken Uncertainty Principle: > You can never be sure how many beers you had last night. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help