Re: [R] adjusting "levels" after subset a table

From: Paulo Justiniano Ribeiro Jr <paulojus_at_c3sl.ufpr.br>
Date: Sun, 9 Dec 2007 01:52:18 -0200 (BRST)

running
my.df$my.var <- factor(my.df$my.var)

seems to do the job

P.J.

On Sat, 8 Dec 2007, Milton Cezar Ribeiro wrote:

> 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.
>
Paulo Justiniano Ribeiro Jr
LEG (Laboratorio de Estatistica e Geoinformacao) Universidade Federal do Parana
Caixa Postal 19.081
CEP 81.531-990
Curitiba, PR - Brasil
Tel: (+55) 41 3361 3573
Fax: (+55) 41 3361 3141
e-mail: paulojus AT ufpr br
http://www.leg.ufpr.br/~paulojus



53a Reuniao Anual da Regiao Brasileira da Soc. Internacional de Biometria 14 a 16/05/2008, UFLA, Lavras,MG
http://www.centenario.ufla.br/

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:58:40 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 - 07: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.