Hi, Without more information I guess your problem is that the level name still exists in the factor whereas it doesn't appear anymore in the factor. If so, try droplevels.
Alain Guillet On 13/06/13 14:02, Shane Carey wrote: > I have a dataframe consisting of factors in one column. Im trying to remove > certain levels using the following code: > toBeRemoved1<-which(DATA$UnitName_1=="lake") > DATA<-DATA[-toBeRemoved1,] > > However it will not remove the level "lake" > > In the past this worked for me, but its not working now. Any help > appreciated. > > Thanks > -- Alain Guillet Statistician and Computer Scientist SMCS - IMMAQ - Université catholique de Louvain http://www.uclouvain.be/smcs Bureau c.316 Voie du Roman Pays, 20 (bte L1.04.01) B-1348 Louvain-la-Neuve Belgium tel: +32 10 47 30 50 Accès: http://www.uclouvain.be/323631.html ______________________________________________ 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.