【发布时间】:2020-02-06 15:28:19
【问题描述】:
我确实有一列文本,我想从中提取一些信息并将它们放入一个新列中。
例子:
Text-1 <- "issue : there has been considerable changes and it is going on. finding : we need further investigation on this. resolution: please check the validity"
Text-2 <- "issue : there has been considerable changes and it is going on. resolution: please check the validity"
Text-3 <- "finding : we need further investigation on this. resolution: please check the validity"
Text-4 <- "please check the validity"
我正在寻找的解决方案是当我们应用 R 正则表达式时,预期的结果应该如下所示。文本根据其存在分为 3 个不同的列。
文本-1
issue <- there has been considerable changes and it is going on
finding <- we need further investigation on this
resolution <- please check the validity
文本-2
issue <- there has been considerable changes and it is going on
finding <- NA
resolution <- please check the validity
文本-3
issue <- NA
finding <- we need further investigation on this
resolution <- please check the validity
文本-4
issue <- NA
finding <- NA
resolution <- please check the validity
请帮忙
【问题讨论】: