Apparently, indexing a list with attributes returns a list without the attributes.
> l <- list(a=1:3, b=7)
> attr(l, 'x') <- 67
> l
$a
[1] 1 2 3
$b
[1] 7
attr(,"x")
[1] 67
> l[c('a','b')]
$a
[1] 1 2 3
$b
[1] 7
Attributes are gone. Is it possible to index a list while preserving its attributes?
?"["
). You could write your own subset function (or define a class and an indexing method for it).