[R] assign object to list

From: Christian Bieli <christian.bieli_at_unibas.ch>
Date: Fri 20 Jan 2006 - 22:14:00 EST


Dear all

I want to generate a list like this:

a <- data.frame(1:10)
attr(a,'myattribute') <- 'something'
b <- data.frame(11:20)
attr(b,'myattribute') <- 'anything'
mylist <- list(a,b)

Is there a way to place the dataframes into the list giving them the attribute at the same time?
I don't want to create all the dataframes in my workspace first. I tried it with parentheses {}, but it obviously did not work.

Thanks in advance.
Christian

-- 
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH-4051 Basel
Tel.: +41 61 270 22 12
Fax:  +41 61 270 22 25
christian.bieli@unibas.ch
www.unibas.ch/ispmbs

______________________________________________
R-help@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
Received on Fri Jan 20 22:57:25 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:07 EST