DocumentTermMatrix 만들기 :: 감정 분석 - mindscale
Skip to content

DocumentTermMatrix 만들기

패키지 불러오기

library(tm)

DocumentTermMatrix 만들기

corpus <- VCorpus(VectorSource(mobile$Texts))

##  제거할 단어 목록 확인
stopwords()
stopwords("SMART")

dtm <- DocumentTermMatrix(corpus,
                          control = list(tolower = T,
                                         removePunctuation = T,
                                         removeNumbers = T,
                                         stopwords = stopwords("SMART"),
                                         weighting = weightTfIdf))

dtm