Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to fixa 'replacement has 21 rows, data has 20' Error in Rstudio

$
0
0

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


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>