Hi Farnoosh, If I understand it correctly, dat <-read.table(text="Var1
Great>5 great 'less great<2' 'approx great11'",sep="",header=TRUE,stringsAsFactors=FALSE) dat$Var1 <- gsub(".*(great).*","\\L\\1",dat$Var1,ignore.case=TRUE,perl=TRUE) dat$Var1 #[1] "great" "great" "great" "great" A.K. On Thursday, February 13, 2014 5:04 PM, farnoosh sheikhi <farnoosh...@yahoo.com> wrote: Hi Arun, One more questions, I have a column which is a character column like below. I want to replace these values to a unique value like great. How do I do that? Thanks. Var1 Great>5 great less great<2 approx great11 Regards, Farnoosh Sheikhi ______________________________________________ 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.