[R] Remove empty levels in subset

svo s.vanommen at uu.nl
Tue Jun 26 14:06:05 CEST 2012


Hi,

I have exactly the same question (how to remove empty levels in my subset),
but in my case the factor command does not work, because my dataframe is not
atomic

> Try this:
>
> test2$a <- factor(test2$a)
>

R gives me the error message:

Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?

Do you have advice?

Thank you

--
View this message in context: http://r.789695.n4.nabble.com/Remove-empty-levels-in-subset-tp873967p4634499.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list