[R] List seems to drop empty levels of factors when containing them

2004-11-09 Thread Andrew Robinson
Greetings R community, I am curious about the following behaviour: if I define a factor, and then store a subset of it in a list, the stored version seems to drop levels that were not included in the subset. E.g. .. mask - c(T, F) grp.1 - factor(c(1,2)) list(grp.1) [[1]] [1] 1 2 Levels: 1 2

Re: [R] List seems to drop empty levels of factors when containing them

2004-11-09 Thread Sundar Dorai-Raj
Andrew Robinson wrote: Greetings R community, I am curious about the following behaviour: if I define a factor, and then store a subset of it in a list, the stored version seems to drop levels that were not included in the subset. E.g. .. mask - c(T, F) grp.1 - factor(c(1,2)) list(grp.1) [[1]]