Home > database >  R language to do text analysis error
R language to do text analysis error

Time:09-16

Setwd (" D://Desktop ")
The install packages (" jiebaRD ")
The library (jiebaRD)
The install packages (" jiebaR ")
The library (jiebaR)
Wk<- the worker ()
# add user custom thesaurus
Wk<- the worker (user="dictionary. TXT") # seemed to add also useless
# remove stop words
Wk<- the worker (stop_word="ChineseStopWords. TXT")
# read text file
Wk [file. Choose a ()]
# choose file
after wordF<- scan (file. Choose (), sep="\ n", what="", encoding=" utf-8 ")
# word frequency statistics and sorting
Df<- freq (wk [f] a)
Df<- df [order (- $freq df)]
# SQLDF installation package
The install packages (" SQLDF ")
The library (" SQLDF ")
# extract before 100
Df<- SQLDF (" select [char], [freq] from df where length ([chars]) & gt; 1 limit 100 ")
Df<- df [nchar (df $char) & gt; 1,]
  • Related