[R] Is there a way to have 'comment' keep a list?

Mario Valle mvalle at cscs.ch
Tue Nov 9 12:11:50 CET 2010


Look at the help page, the example does exactly this by putting a two 
element vector of strings as comment.
Hope it helps
                                 mario

On 09-Nov-10 11:36, Tal Galili wrote:
> Hello all,
>
> I recently discovered the "comment" command.
> I see it can only hold a vector of characters.
>
> Is there a way (or an alternative), to make it possible to have it keep a
> list?
> (for example, to keep different pieces of information like date of creation,
> information of each variable and so on)
>
> The closest solution I can think of is using 'names' on the vector, like
> this:
> x<- 1
> comment(x)<- letters
> names(comment(x))<- LETTERS
> x
> comment(x)
>
>
> Any other suggestions?
> (or general best practices for the "comment" command ?)
>
> Thanks,
> Tal
>
> ----------------Contact
> Details:-------------------------------------------------------
> Contact me: Tal.Galili at gmail.com |  972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> ----------------------------------------------------------------------------------------------
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.

-- 
Ing. Mario Valle
Data Analysis and Visualization Group            | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82



More information about the R-help mailing list