将不同行中的字符串合并为一个

时间:2020-10-28 15:49:13

标签: r

输入数据:

df <- data.frame(id = c(1,1,2,3,1), text = c("hi","merge","another","no","here"), stock = c("google","yahoo","google","amazon","google"))

如果id和stock相同,如何合并text column的行文本。

示例输出

df <- data.frame(id = c(1,1,2,3), text = c("hi here","merge","another","no") stock = c("google","yahoo","google","amazon"))

0 个答案:

没有答案