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")