词云中的下标超出范围错误

时间:2019-05-11 06:27:29

标签: r tm

Corpus <- Corpus(VectorSource(Seri$comments))
 Corpus <- VCorpus(VectorSource(Seri$Comments))
 #convert the text into lower case
  Corpus <- tm_map(Corpus, content_transformer(tolower))
 # remove numbers
  Corpus <- tm_map(Corpus, removeNumbers)
 Corpus <- tm_map(Corpus, removeWords, stopwords("englsih"))
 Corpus <- tm_map(Corpus, removePunctuation)
 Corpus <- tm_map(Corpus,stripWhitespace)
 #streaming texts
  #Corpus= tm_map(Corpus, stemDocument)
  # remove additional words
  Corupus <- tm_map(Corpus, removeWords, c("get", "told", "gave","get","can","said","asked","will","is","spoke","got", "really","even", "of", "the","has","that","for"))
 Corpus[[1]][1]
Error in x$content[[i]] : subscript out of bounds

tried this not able remove error

0 个答案:

没有答案