Hello, Try the following. (In Andrija's code I've changed 'df' to 'DF', 'df' is a R function name)
DF <- read.table( ... etc ... tc <- textConnection(" Column1(Gen) Column2(Name) A_1 Wynda A_2 A_2 B_1 B_1 B_3 Wynda OP1_1 Wynda OP1_5 OP1_5 ") TransTable <- read.table(tc, header=TRUE, stringsAsFactors=FALSE) close(tc) nrTrans <- nrow(TransTable) for(iTrans in 1:nrTrans){ i <- DF$Gen == TransTable[iTrans, 1] DF$Gen[i] <- TransTable[iTrans, 2] } # See first 6 lines of result head(DF) That's it. Hope this helps, Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/How-to-replace-the-values-in-a-column-tp4430448p4431983.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.