【发布时间】:2021-09-27 18:02:42
【问题描述】:
我正在使用 tm 包中的 removewords 清理样本数据,但 removeWords 函数会连接删除后的单词。应该是“环保死蛙”“环保死老鼠”。有人可以指导吗?
library(tm)
dc<-c("environmental dead frog still","environmental dead mouse come")
manualremovelist<-c("the","does","doesn't","please","new","ok","one","cant",
"doesnt","can","still","done","will","without","seen",
"also","danfoss","case","doesn´t","due","need","occurs","made",
"using","now","make","makes","needs","put","okay","sno","since","therefore",
"found","milwaukee","probably","got","finally","isnt","per","two",
"obvious","unable","must","nos","3nos","1no",".","phone","tel","attached",
"given","find","have","see","be","give","do","come","use","make","get",
"try","call","request")
dc<-removeWords(dc,manualremovelist)
"environmentaldeadfrog" "environmentaldeadmouse"
【问题讨论】: