0

Below is the Text Mining (Opinion Mining) work code.

When you do this with a cluster analysis The line will point upward.

In some illustrative works, there were graphs that point the line to the right.

I've also done a lot of searching and I've been told to use factoextra and dendextend.

But I do not know what I entered wrong, or I found the wrong way.

How do I fix Can you draw a line to the right rather than to the top?

library(tm)
library(XML)

crudeCorp<-VCorpus(VectorSource(readLines(file.choose())))
crudeCorp <- tm_map(crudeCorp, stripWhitespace)
crudeCorp<-tm_map(crudeCorp, content_transformer(tolower))
crudeCorp<-tm_map(crudeCorp, removeWords, stopwords("english"))

myStopwords <- c(stopwords("english"),"noth","two")
crudeCorp <- tm_map(crudeCorp, removeWords, myStopwords)
crudeCorp<-tm_map(crudeCorp,removeNumbers)
crudeCorp <- tm_map(crudeCorp, stemDocument)


crudeDtm <- TermDocumentMatrix(crudeCorp, control=list(removePunctuation=T))



tdm2 <- removeSparseTerms(crudeDtm, sparse = 0.95)
m2 <- as.matrix(tdm2)
# cluster terms
distMatrix <- dist(scale(m2))
fit <- hclust(distMatrix, method = "ward.D")

plot(fit,,main="test")
yome
  • 953
  • 2
  • 7
  • 11
  • 2
    Is this what you need? [horizontal dendrogram in R with labels](https://stackoverflow.com/q/14118033/4752675) – G5W Sep 13 '17 at 17:05
  • @G5W Yes, this is it. When I run it, my data is unique ... it seems more complex than going up. Thanks for your reply. I was worried that I could not understand what the title was saying. Thank you. – yome Sep 13 '17 at 18:39
  • @G5W wow, you could actually make sense out of this Q – Has QUIT--Anony-Mousse Sep 14 '17 at 06:37

0 Answers0