Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] persistance of factor levels in a data frame

Lefebure Tristan

2005-02-28

Replies:

Hi,
Just something I don't understand:

data <- data.frame(V1=c(1:12),F1=c(rep("a",4),rep("b",4),rep("c",4)))
data_ac <- data[which(data$F1 !="b"), ]
levels(data_ac$F1)  

Why the level "b" is always present ?

thanks

Tristan, R 2.0.1 for Linux Fedora 3

--
------------------------------------------------------------
Tristan LEFEBURE
Laboratoire d'��cologie des hydrosyst��mes fluviaux (UMR 5023)
Universit�� Lyon I - Campus de la Doua
Bat. Darwin C 69622 Villeurbanne - France

Phone: (33) (0)4 26 23 44 02
Fax: (33) (0)4 72 43 15 23

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.