Re: [R] Need some help on Text manipulation.
uot;),unique)) Dat1$att<-ifelse(vec1%in%Replace,vec1,Dat1$att) Dat1$att # [1] "b" "b" "b" "d" "uu" "t" "vv" "c" "a" "d" "a" "b" "b" "b" "b&qu
Re: [R] Need some help on Text manipulation.
Hi, If you only need "aa" to be replaced by "a", "bb" by "b" and so on, try the following: Dat$att <- as.factor(substr(Dat$att,1,1)) HTH, Pascal Le 15/01/2013 18:48, Christofer Bogaso a écrit : Dear all, Let say I have following data-frame: Dat <- structure(list(dat = c(-0.38779584295632