# Hierarchical clustering on principle components for multidimensional scaling

Essentially I have a data set of distant objects in which I've loaded onto factors using a multidimensional scaling technique. From my understanding, the factor loadings only differ between MDS and PCA via the distance matrix used in MDS'.

I am attempting to cluster my MDS points, however whenever I use r's base clustering algorithms (such as hclust) I get the following error:

hclust size cannot be NA nor exceed 65536


The problem is that the MDS creates far too many points for hclust to handle.

In searching for a solution I found the HCPC package (hierarchical clustering on principal components).

This package clusters data points based off of the factors from the PCA. My question is, since PCA and MDS are similar in their output structures, would using a PCA clustering algorithm on MDS data present incorrect information?

My example code can be followed if more information is needed.

distancematrix.dst <- dist(data, method = "binary")
cmd <- cmdscale(distancematrix.dst, k=3)
cmd_cluster <- fviz_nbclust(cmd, kmeans, nstart = 25, method = "gap_stat",
k.max = 50, nboot = 500)+
+ labs(subtitle = "Gap statistic method")
cmd_frame <- as.data.frame(cmd)
plot_cluster <- HCPC(cmd_frame, nb.clust = -1, method = "ward")


And just to be clear, my question is not about using r or software, rather applying MDS data to a PCA clustering algorithm.

Thanks!