Re: [R] add info

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Fri, 18 May 2007 09:00:53 +0200

you could use attributes, e.g.,

dat <- data.frame(x = 1:3, y = letters[1:3])

attr(dat, "name") <- "my data.frame"
attr(dat, "author") <- "John Smith"
attr(dat, "date") <- "2007-05-18"

##################

dat
attributes(dat)

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


> hi all:
> If there's a dataframe:
>
> x y
> 1 a
> 2 b
> 3 c
>
> The info of the data such as :
>
> name
> date
> author
>
> The result I want is:
>
> name
> date
> author
> x y
> 1 a
> 2 b
> 3 c
>
> In other words,I wanna add the info above the dataframe.
>
> How can I do it ?
>
> Thanks a lot!
>
>
> My best
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 May 2007 - 07:05:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 May 2007 - 07:31:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.