data0freak
data0freak

Reputation: 43

Dissimilarity function for Text Mining in R

I am using the TM package in R to perform Clustering on Text Documents. While running the dissimilarity function on a TDM I am facing the following Error

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘dissimilarity’ for signature ‘"TermDocumentMatrix"’

Code Snippet

docsTDM <- tm_map(docs8,PlainTextDocument)
docsTDM1 <- TermDocumentMatrix(docsTDM)
docsdissim <- dissimilarity(docsTDM1, method = "cosine")

I am referencing the following link to reach to the docs8 step

http://www.r-bloggers.com/text-mining-in-r-automatic-categorization-of-wikipedia-articles/

Upvotes: 4

Views: 3196

Answers (1)

keegan
keegan

Reputation: 2992

It looks like the function dissimilarity() is no longer supported in the tm package, so the code you're looking at won't work.

See the 'Deprecated and Defunct' section in the recent package updates for tm.

The authors suggest using proxy::dist() instead.

Upvotes: 4

Related Questions