The Luminance Illusion With gganimate

Kevin Feasel

2018-08-23

R

David Smith highlights an example of the luminance illusion:

Colin created this animation in R using the gganimate package (available on GitHub from author Thomas Lin Pederson), and the process is delightfully simple. It begins with a chart of 10 “points”, each being the same grey square equally spaced across the shaded background. Then, a simple command animates the transitions from one point to the next, and interpolates between them smoothly:

library(gganimate)
gg_animated <- gg + transition_time(t) + ease_aes('linear')

Check it out, both as a parlor trick and a way of getting a grip on the gganimate package.

Related Posts

Donating To The R Foundation

Mark Niemann-Ross explains how you can donate to the R Foundation: I benefit from the work of the R Foundation. They oversee the language, but also encourage a healthy ecosystem. CRAN happens because of them. Updates to R happen because of them. useR! happens because of them. Every day, you and I are the recipients […]

Read More

Timing Means Of Groups With R

John Mount shares some performance measures pitting data.table against various dplyr methods for calculating grouped means: In this reproduction attempt we see:– The dplyr time being around 0.05 seconds. This is about 5 times slower than claimed.– The dplyr sum()/n() time is about 0.2 seconds, about 5 times faster than claimed.– The data.table time being around 0.004 seconds. This is about three times as […]

Read More

Categories

August 2018
MTWTFSS
« Jul Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031