我有一个有两列的数据帧。一列包含句子列表,另一列包含单词。例如:根据两列之间的匹配值(精确)过滤数据帧
words sentences
loose Loose connection several times a day on my tablet.
loud People don't speak loud or clear enough to hear voicemails
vice I strongly advice you to fix this issue
advice I strongly advice you to fix this issue
现在我要过滤这些数据帧,这样我只得到具有恰好匹配句子中的单词的那些行:
words sentences
loose Loose connection several times a day on my tablet.
loud People don't speak loud or clear enough to hear voicemails
advice I strongly advice you to fix this issue
这个词“副”并不完全匹配,因此必须将其删除。我在数据框中有近20k行。有人可以建议我使用哪种方法来完成这项任务,这样我就不会失去太多的表现。
这种方法比使用str_detect更快,因此接受这个答案。 – Venu