I have list of data.frames and I wonder whether there is an easy indexing way of getting all third columns of all data.frames. Or all columns named x?
Speaking R:
lapply(names(mylist),function(x) mylist[[x]][,3])
Is there any way to do it by just indexing, like mylist[[]][,3]? (which does not work obviously)
EDIT: And how do you do that, when you want to use a function like nlevels in that, like
lapply(names(mylist),function(x) nlevels(mylist[[x]][,3]))
given that column 3 is a factor.
Maybe this is somewhat easier: