我有一个名为“companynames”的数据框,其中包含大约9000个公司名称。我想从这些特定单词的数据中删除那些公司名称
stopwords <- c("Trade","Investment","Trading")
答案 0 :(得分:0)
我相信您只需使用filter
包中的dplyr
函数以及grepl
函数。
stopwords <- c("Trade","Investment","Trading")
stopwords <- paste(stopwords,collapse = "|")
df %>% filter(!grepl(stopwords,companynames))