Wordcloud

result1

 

library(KoNLP)
필요한 패키지를 로딩중입니다: rJava
필요한 패키지를 로딩중입니다: stringr
필요한 패키지를 로딩중입니다: hash
hash-2.2.6 provided by Decision Patterns

필요한 패키지를 로딩중입니다: tau

필요한 패키지를 로딩중입니다: Sejong

Successfully Loaded Sejong Package.

Checking user defined dictionary!

 

f <- file(“d:/e-mail-essay.txt”,blocking=F)
> txtLines <- readLines(f)
> nouns <- sapply(txtLines,extractNoun,USE.NAMES=F)
> nouns

head(unlist(nouns), 20)
> head(unlist(nouns))
> write(unlist(nouns),”d:/android_dev_diary-1.txt”)
> revised <- read.table(“d:/android_dev_diary-2.txt”)
> nrow(revised)
[1] 6
> wordcount <- table(revised)
> length(wordcount)
[1] 6
> sort(wordcount, decreasing=T)
> sort(wordcount,decreasing=F)

>wordcount <- head(sort(wordcount,decreasing=T),15)

>pie(wordcount)

result2
> install.packages(“wordcloud”)
> install.packages(“RColorBrewer”)
> library(wordcloud)
> library(RColorBrewer)
> display.brewer.all()
> pal<-brewer.pal(9,”Set1″)
> wordcloud(names(wordcount),freq=wordcount, scale=c(5,1),rot.per=0.25,min.freq=1, random.order=F,random.color=T,colors=pal)
>savePlot(“d:/result1.png”,type=”png”)

result1

 

16 thoughts on “Wordcloud

  1. I simply want to say I am new to blogging and site-building and seriously savored this page. Almost certainly I’m likely to bookmark your website . You actually come with exceptional posts. Thanks a bunch for revealing your blog site.

답글 남기기

이메일 주소를 발행하지 않을 것입니다. 필수 항목은 *(으)로 표시합니다