[R] add info

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.be
Fri May 18 09:00:53 CEST 2007


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


----- Original Message ----- 
From: "XinMeng" <xmeng at capitalbio.com>
To: <r-help at stat.math.ethz.ch>
Sent: Friday, May 18, 2007 9:05 AM
Subject: [R] add info


> 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



More information about the R-help mailing list