>>> I think this is a really bad idea. data.frames are not meant to be >>> used in this way. Why not use a list of lists? >> >> It can be very convenient, but I suspect the original poster is >> confused about the different between vectors and lists. > > I wouldn't be surprised if someone were confused, since my reading of some > (but not all) of the help documents has led me to think that lists _were_ > vectors, just not vectors of atomic mode. And one oft-illustrated method for > creating a list is: alist <- vector(mode="list", length=10). I am perhaps > less confused than I was two years ago but my confusion about all the > possible permutations of mode, typeof, expression, formula, and class and > the extraction methods therefrom definitely persists. I think the authors of > the documentation are of divided opinion or usage on this topic.
I probably should have said "atomic vectors" - it's easy to get confused when you fail to be specific. Data frames add even more confusion: > is.vector(as.vector(mtcars)) [1] FALSE (That behaviour matches the documentation, but it's still confusing!) Hadley -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ ______________________________________________ R-help@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.