c:nmp:using_open_api_example
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
c:nmp:using_open_api_example [2017/05/08 09:54] – created hkimscil | c:nmp:using_open_api_example [2020/06/09 13:43] (current) – removed hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{all_comb.xlsx}} | ||
- | < | ||
- | library(RCurl) | ||
- | library(rjson) | ||
- | library(twitteR) | ||
- | library(digest) | ||
- | library(ROAuth) | ||
- | library(KoNLP) | ||
- | library(rJava) | ||
- | library(tm) | ||
- | library(wordcloud) | ||
- | library(XLConnect) | ||
- | |||
- | setwd (" | ||
- | |||
- | rm(list=ls()) | ||
- | ani<- file.path(" | ||
- | |||
- | anisheet <- readWorksheetFromFile(ani, | ||
- | ani.text <- Corpus(VectorSource(anisheet$plotStory)) | ||
- | result.text <- ani.text | ||
- | |||
- | |||
- | myCorpus <- Corpus(VectorSource(result.text)) | ||
- | myCorpus <- tm_map(myCorpus, | ||
- | myCorpus <- tm_map(myCorpus, | ||
- | myCorpus <- tm_map(myCorpus, | ||
- | myStopwords <- c(stopwords(' | ||
- | myCorpus < | ||
- | |||
- | inspect(myCorpus[1: | ||
- | |||
- | myTdm <- TermDocumentMatrix(myCorpus, | ||
- | mat <- as.data.frame(as.matrix(myTdm)) | ||
- | write.table(mat, | ||
- | |||
- | pal <- brewer.pal(12," | ||
- | |||
- | # 폰트 세팅. 띄어쓰기나 대소문자에 민감하다는 점에 주의 | ||
- | # 맑은고딕 : windowsFonts(malgun=windowsFont(" | ||
- | # 나눔고딕 : windowsFonts(malgun=windowsFont(" | ||
- | windowsFonts(malgun=windowsFont(" | ||
- | |||
- | m <- as.matrix(myTdm) | ||
- | # calculate the frequency of words | ||
- | v <- sort(rowSums(m), | ||
- | myNames <- names(v) | ||
- | k <- which(names(v)==" | ||
- | myNames[k] <- " | ||
- | d <- data.frame(word=myNames, | ||
- | # | ||
- | wordcloud(d$word, | ||
- | </ | ||
- | |||
- | {{ani_plot.png}} | ||
- | |||
c/nmp/using_open_api_example.1494206642.txt.gz · Last modified: 2017/05/08 09:54 by hkimscil