【发布时间】:2017-11-25 11:41:46
【问题描述】:
我有一个包含两列的 .csv 文件。第一个是 ID,第二个是文本字段。但是,文本字段中的文本被拆分为延伸到另一行的句子,因此文件如下所示:
ID TEXT
TXT_1 This is the first sentence
NA This is the second sentence
NA This is the third sentence
TXT_2 This is the first sentence of the second text
NA This is the second sentence of the second text
我想做的是合并文本字段,使其看起来像这样:
ID TEXT
TXT_1 This is the first sentence This is the second sentence This is the third sentence
TXT_2 This is the first sentence of the second text This is the second sentence of the second text
在 R 中有一个简单的解决方案吗?
【问题讨论】: