0

我使用下面的代码给我发短信 - http://www.publications.parliament.uk/pa/ld201213/ldhansrd/text/130110-0002.htm#13011048001187

我将几段复制到一个文本文件中并在下面运行代码。

   require(SnowballC)
   require(tm)
   require(wordcloud)

   getwd()
   src = paste0(getwd(),"/input")
   lords <- Corpus (DirSource(src))
   #inspect(lords)

   lords <- tm_map(lords, stripWhitespace)
   lords <- tm_map(lords, tolower)
   lords <- tm_map(lords, removeWords, stopwords("english"))

   lords <- tm_map(lords, removeWords, "noble")
   lords <- tm_map(lords, removeWords, c("lord","need","will"))

   dictCorpus = lords
   lords <- tm_map(lords, stemDocument, dictionary=dictCorpus)
   wordcloud(lords, scale=c(5,0.5)
      , max.words=100
      , random.order=FALSE
      , rot.per=0.35
      , use.r.layout=FALSE
      , colors=brewer.pal(8, "Dark2"))

但我得到以下错误 lords <- tm_map(lords, stemDocument, dictionary=dictCorpus) FUN(X[[1L]], ...) 中的错误:FUN(X[[1L]], ...) 中的错误:

  unused argument (dictionary = c("   anxiety among  involved  sickle cell services   complexity   services needed effectively places  largely outside  scope   clinical commissioning groups. many  concerned   type  policies     place  ensure   patient-centred, integrated approach  care engages primary care  community interests across health, social  community care.    help  reduce morbidity, needless hospital care   health inequalities experienced   seriously marginalised sector.", "", "  expectations    ccgs  local health  well- boards  aim  reflect  make-   respective client communities. , given   steady establishment  ccgs   view  community provision  sickle cell disorder management   major role  play across  country, especially  high-risk areas within ccgs, can  minister tell  house  priority   given  ccgs  people   sickle cell  thalassaemia community,   feeling concerned, vulnerable  anxious   situation   future?", 

"", "然而,治疗镰状细胞的研究需要 cur"

当我执行 lords <- tm_map(lords, stemDocument, dictionary=dictCorpus)

4

0 回答 0