반응형
library(tm)
library(wordcloud)
library(KoNLP)
library(RColorBrewer)
ktext<-Corpus(DirSource("C:/Rwork/KText", encoding="UTF-8",recursive = TRUE)
words<-unlist(sapply(ktext[[1]]$content, extractNoun, USE.NAMES=FALSE))
words
wordfreq<-table(words)
sort(wordfreq,decreasing=T)[1:12]
wordcloud(names(wordfreq),freq=wordfreq,max.words=50)
wordfreq<-wordfreq[!(names(wordfreq) %in% c("등","한","이","개",들","적","것"))]
wordcloud(names(wordfreq),freq=wordfreq,max.words=50)
반응형