**Revolutions**, and kindly contributed to R-bloggers)

The accidental aRt tumblr (mentioned here a few years ago) continues to provide a steady stream of images that wouldn’t look out of place in a modern art gallery, but which in fact are data visualizations (mostly attempted in R), gone wrong. (Here’s a typical recent entry.) But now, Giora Simchoni has taken this concept to the next level by writing an R package that deliberately creates works of art.

The kandinsky package (available now on Github) takes any dataset as input, and creates an image reminiscent of the work of abstract painter Wassily Kandinsky. The data points are used to position Kandinsky’s typical motifs — rectangles, circles, waves and such — on a digital canvas. And since every data set is different, the resulting “work” is therefore unique. Here, for example, Len Kiefer takes a break from his usual visualizations of economic data to create a Kandinsky plot of mortgage rates:

was going to make my usual time series gif of mortgage rates, but I decided to tween Kandinsky instead. sequence of rates 4 weeks at a time pic.twitter.com/mMnOxGxVcW

— Leonard Kiefer (@lenkiefer) July 27, 2017

Andrew Clark used the same package to generate Kandinsky plots from baseball data. With a simple Shiny app, you can choose a player represented in the Lahman package and use their data to create a chart on the fly:

Behind the scenes, the kandinsky package uses the grid graphics system in R to lay out the elements of the “painting” on a blank canvas. The grid system isn’t often used directly, but it’s what’s behind many of the modern graphics systems in R (notably, lattice and ggplot2). If you’re thinking about creating an entirely new visualization in R, as Giora Simchoni has done here, the grid package is well worth looking into. You can learn a lot about its capabilities in the blog post linked below.

Giora Simchoni: Data Paintings (The Kandinsky Package)

**leave a comment**for the author, please follow the link and comment on their blog:

**Revolutions**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...