How can two strings be concatenated?
问题 How can I concatenate (merge, combine) two values? For example I have: tmp = cbind(\"GAD\", \"AB\") tmp # [,1] [,2] # [1,] \"GAD\" \"AB\" My goal is to concatenate the two values in \"tmp\" to one string: tmp_new = \"GAD,AB\" Which function can do this for me? 回答1: paste() is the way to go. As the previous posters pointed out, paste can do two things: concatenate values into one "string", e.g. > paste("Hello", "world", sep=" ") [1] "Hello world" where the argument sep specifies the character