I've created very simple clusters in iris:
library(factoextra)
iris.kmeans<-kmeans(iris[, c(1,2)], centers=3)
fviz_cluster(iris.kmeans, data=iris[,c(1,2)])
which produces the cluster plot that you'd expect. However, when I put repel=T in it:
fviz_cluster(iris.kmeans, data=iris[,c(1,2)], repel = T)
I get the error
Error in replace_null(unclass(data), label = "a", angle = 0) : could not find function "replace_null"
I've never seen this before! Any ideas?
(the dataset I'm actually doing this with has a lot of row names that are not integers, and the plots are really overwhelming).
I've tried going back to previous code where this worked, and I'm pretty sure this is identical to what I used to do.