Skip to content
Prev 168907 / 398506 Next

concatenating 2 text columns in a data.frame

yes, try this:

dat <- read.table(textConnection(
"C1  C2  C3  C4  C5
A   B   F   C   Q
G   H   I   J   T
K   D   R   S   E
P   L   M   N   O"
), header = TRUE)
closeAllConnections()

dat$NewCol <- do.call(paste, c(dat[c("C3", "C4")], sep = ""))
dat


I hope it helps.

Best,
Dimitris
Shaun Grannis wrote: