使用R中的多个单词搜索2列

时间:2018-10-16 18:44:20

标签: rstudio

使用R做到这一点的任何简单方法吗?

col1 = Subject, col2 = Body

library(dplyr)
library(stringr)


scroll <- read.csv("file")%>%
  filter(str_detect(Subject, "scroll"))
Scroll <- read.csv("file")%>%
  filter(str_detect(Subject, "Scroll"))
SCROLL <- read.csv("file")%>%
  filter(str_detect(Subject, "SCROLL"))
reverse <- read.csv("file")%>%
  filter(str_detect(Subject, "reverse"))
Reverse <- read.csv("file")%>%
  filter(str_detect(Subject, "Reverse"))
REVERSE <- read.csv("file")%>%
  filter(str_detect(Subject, "REVERSE"))

0 个答案:

没有答案