I have 583 observations within my dataset, out of which I need to use 100 to make a Dendrogram. But I am getting the following error in the plot() function step.
how to troubleshoot/solve this?
##For 100 Observations
set.seed(44)
idx_100 <- sample(1:nrow(ilpd_df), 100)
distance_matrix_100 <- dist(as.matrix(ilpd_df[idx_100,-c(1,2,10,11)]),
method = "euclidean") #Creates Hierarchical Clustering Solution
hc_100 <- hclust(distance_matrix_100)
plot(hc_100, hang = -1, labels=ilpd_df$Class) #CANT PLOT DUE TO INVALID INPUT ERROR