[R] adjusting "levels" after subset a table

From: Milton Cezar Ribeiro <milton_ruser_at_yahoo.com.br>
Date: Sat, 8 Dec 2007 19:26:09 -0800 (PST)


Dear all,

I have a data.frame with a factor collumn with about 10 levels. After extract a subset of this data.frame, by selecting 2 of my 10 levels, the new data.frame continue with original number of levels. How can I adjust it in a manner that when I try levels(my.df) I receive the actualyzed number of levels?

By the way, I read my file using reab.table.

I tryed solve it with : levels(my.df$my.var)<-unique(my.df$my.var) but the problem remain.

Many thanks,

miltinho
Brazil

 para armazenamento!

        [[alternative HTML version deleted]]



R-help_at_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. Received on Sun 09 Dec 2007 - 03:33:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 09 Dec 2007 - 06:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.