Getting the coordinates of every observation at each iteration of kmeans in R
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 5 years ago . I would like to construct an animation of the kmeans clustering algorithm in R. The animation would show each of the observations (rows) in the the dataset plotted in 2 (or 3) dimensions and then have them move into their clusters as each iteration ticks by. For this I would need to access the coordinates of the observations at each iteration. Where in the kmeans package can I