Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

(This article was first published on is.R(), and kindly contributed to R-bloggers)

This is probably the coolest-looking thing I’ve figured out how to do with raster images in R. Similar to (although not quite as impressive as) theseimages by Jeff Clark, I alter the simple k-means approach described in the previous post to cluster primarily in Cartesian space, rather than in color space. This produces, essentially, Voronoi regions shaded with a region-average color, and the effect is really neat.

Note that increasing nRegions can produce drastically different results, but that kmeans() is quite slow as nRegions increases. Below, you’ll find a few examples, as well as the code. If you use this to make anything impressive, share it with us at @isDotR.