library(usethis)
library(devtools)
library(KoNLP)
library(multilinguer)
library(RColorBrewer)
library(wordcloud)
library(stringr)
request<-read.csv("F://mongtcsv.csv", header = FALSE, stringsAsFactors = FALSE,fileEncoding = "utf-8")
sampledata<-request$V1[1:700]
data_list<- list()
for(i in 1:length(sampledata)){ data<-SimplePos09(sampledata[i]) ;data_list[[i]]<-data}
unlist<-unlist(data_list)
wordlist<-sapply(str_split(unlist,"/"),function(x){x[1]})
tablewordlist<- table(wordlist)
tablewordlist
names(tablewordlist)
sort(tablewordlist,decreasing = T)[1:100]
tablewordlist_result<-tablewordlist[nchar(names(tablewordlist))>1]
tablewordlist_result<-sort(tablewordlist_result,decreasing = T)[1:100]
word<-names(tablewordlist_result)
count<-as.numeric(tablewordlist_result)
windows() // 나는 여기에 추가했다. ############################################
mycolor<-brewer.pal(n=11,name ="Set1")
wordcloud(words = word,freq = count,random.order = F,colors = mycolor)
savePlot("F://wordcloud.png" , type="png")
[ R ] Java에서 R 을 써서 wordcloud 나타내기 (Rcaller, wordcloud, Rcode) (0) | 2020.05.28 |
---|---|
[ R ] KoNLP 설치 안될 때 해결 방법 (0) | 2020.05.28 |