The R package gganimate enables to animate plots. It is particularly interesting to visualize the intermediate results of an algorithm, to see how it converges towards the final results. The following illustrates this with K-means clustering. The outline of this post is as follows: We will first generate some artificial data to work with. This allows to visualize the behavior of the algorithm....