So I'm working on K-Modes and plotting right now. The issue is that you need a numeric matrix for K-Modes, which is fine and all until I go to graph. The graph itself looks great, save for the numbers. I want the categorical variables that were converted numerically to be turned back into their respective string counter parts. Here is the example plot. I would like to turn the X values of 1-5 into like Poor, Excellent, Good
Here is the MVE code
dataFrame <- DATA
for (column in colnames(dataFrame)) {
dataFrame[[column]] <- as.numeric(dataFrame[[column]])
}
dataFrame <- data.matrix(dataFrame)
cl <- kmodes(dataFrame, 2)
# plot(dataFrame, col = cl$cluster)
# points(cl$modes, col = 1:5, pch = 8)
plot(jitter(dataFrame), col = cl$cluster, main = "Results")
points(cl$modes, col = 1:10, pch = 8, cex = 20)
DATA can be data frame consisting of only categorical variables (so I suppose you can throw in some strings there?).