How to map the levels of a factor by a reference vector or list?
a<-factor(sample(1:3,20,T))
b<-c("1"="B","2"="C","3"="A")
levels(a)<-list("1"="B","2"="C","3"="A")
How to map the levels of a factor by a reference vector or list?
a<-factor(sample(1:3,20,T))
b<-c("1"="B","2"="C","3"="A")
levels(a)<-list("1"="B","2"="C","3"="A")
Copyright © 2021 Jogjafile Inc.
something like this???
See
?factor
for further details.