我正在尝试从数据框 twitter 中获得像 @someone @somebody 这样的 Twitter 数据的提及,并创建一个新的数据框,其中包含谁发了推文以及他们提到了哪些人的信息。
例子:
tweets <- data.frame(user=c("people","person","ghost"),text = c("Hey, check this out
@somebody @someone","love this @john","amazing"))
结果在这个数据框上:
**user text**
*people Hey, check this out @somebody @someone*
*person love this @john*
*ghost amazing*
期望的结果是:
**id mention**
*people @somebody*
*people @someone*
*person john*
*ghost*
你们能帮帮我吗?