Hi, On Tue, Jun 26, 2012 at 8:06 AM, svo <s.vanom...@uu.nl> wrote: > 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?
I have two pieces of advice. 1. Don't try to use factor() on your entire data frame, but only on a single column at a time, as shown in the example you included. 2. Provide an example of your data using something like dput(head(mydata, 10)) so we can offer actual working code. Sarah -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.