[R] Analysing the output from skmeans/clustering

Ashim Kapoor ashimkapoor at gmail.com
Sun May 28 09:55:09 CEST 2017


Dear All,

Here is a small example:

library(skmeans)
library(tm)
data("crude")
#Examine the first document
inspect(crude[[1]])

dtm <- DocumentTermMatrix(crude, control =
                           list(removePunctuation = TRUE,
                               removeNumbers = TRUE,
                                stopwords = TRUE))
clus <- skmeans(dtm,3)
names(clus)

Is there any way I can get the document number of the  prototypes ? Also
can I get the 3 closest documents to each prototype ? By prototype I mean
the cluster centers.

I know can compare each row of the DocumentTermMatrix with the prototypes
to test for equality and I can manually compute the distance of each
Document from a prototypes,but I was wondering if such a tool already
exists.

Best Regards,
Ashim

	[[alternative HTML version deleted]]



More information about the R-help mailing list