【发布时间】:2022-01-04 04:03:11
【问题描述】:
如何将数据框中的主题标签添加到新列中?
这是我的数据框:
dataframe <- data.frame(a = c('A', 'B', 'C', 'D', 'E'),
b = c("hello friends! #goodday",
"the flood getting worse #peoplefirst #sos",
"i love adele new song, it is remarkable",
"john doe loves judo",
"the new variant of covid19 is worrying #staysafe"))
最终的数据框应该是这样的:
a b c
A hello friends! #goodday #goodday
B the flood getting worse #peoplefirst #sos #peoplefirst #sos
C i love adele new song, it is remarkable NA
D john doe loves judo NA
E the new variant of covid19 is worrying #staysafe #staysafe
【问题讨论】:
-
在你的第二行,“#sos”是从哪里来的?