Dear all, 

According to the post I was trying:

factorA = c(2,2,3,3,4,4,3,4,2,2)
levels(factor <- c("lv1","lv2","lv3") )

But this returns NULL and doesn't change factor names. 

Actually, my factor is included in a data.frame, so I also tried: 

levels(df$factorA)[levels(df$factorA)=="2"] <- "lv1"  Also
levels(df$factorA)[levels(df$factorA)==2] <- "lv1"
levels(df$factorA)[levels(df$factorA)=="3"] <- "lv2"
levels(df$factorA)[levels(df$factorA)=="4"] <- "lv3"

then I type table(df$factorA) and it doesn't work either. 

Any help would be appreciated. Thanks, 
u...@host.com



--
View this message in context: 
http://r.789695.n4.nabble.com/factor-with-numeric-names-tp882535p3404942.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.

Reply via email to