Try:

levels(test$Parc)[levels(test$Parc)=="OlÞrdola"] <- "Olèrdola"

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

On 24/07/07, Agustin Lobo <[EMAIL PROTECTED]> wrote:
>
> Which is the proper way to rename a factor?
> If I do:
> test$Parc[test$Parc=="OlÞrdola"]<-"Olèrdola"
> R complains that
> Warning message:
> invalid factor level, NAs generated in: `[<-.factor`(`*tmp*`, test$Parc
> == "OlÞrdola", value = "Olèrdola")
>
> Thanks
> Agus
> --
> Dr. Agustin Lobo
> Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
> LLuis Sole Sabaris s/n
> 08028 Barcelona
> Spain
> Tel. 34 934095410
> Fax. 34 934110012
> email: [EMAIL PROTECTED]
> http://www.ija.csic.es/gt/obster
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to