텍스트마이닝- 패키지 tm 소개(Corpus 말뭉치, tm_map, wordcloud)에 이어서 설명합니다.

앞에서 일단 "crude" 망뭉치 파일(객체)가 있다고 가정합니다.

 

1단계. 망뭉치로 TDM 행렬을 만든다.

 

tdm <- TermDocumentMatrix(crude) 

      # TermDocumentMatrix 함수는 패키지 tm에 들어있는 것 지난 시간에 확인하셨지요.

class(tdm)  # [1] "TermDocumentMatrix" "simple_triplet_matrix"

tdm

 

2단계. TDM을 행렬로 바꿔 확인

as.matrix(tdm)

+ Recent posts