Skip to content
Prev 327369 / 398502 Next

Levels of a factor

On Jul 24, 2013, at 6:25 AM, Borja Rivier wrote:

            
When you take a subset of a factor vector, the levels are not reduced to the unique values in the new vector. There is droplevels function that would need to be applied if you already have such a vector, and there is a drop argument that you need to set to TRUE in the `[.factors` call if you want to "attack the problem at the source".

?`[.factor
?droplevels