Here is my data, enter image description here
I know that I have many missing data which are not available N/A. I wrote in Rstudio to determine the clusters for my data after knowing that the optimum number is 3;
clusters <- kmeans(testData6[,2:9], 3)
testData6$clusters <- as.factor(clusters$cluster
)
Which gave me this error:
Error in $<-.data.frame
(*tmp*
, clusters, value = c(2L, 2L, 2L, 2L, :
replacement has 21 rows, data has 20