Demo video · 2014
LivelyR We show controls for interactive R charts that keep earlier results in view: sweep a setting to see every result layered; rewind through your changes; probe the effect a different earlier setting would be having now.
Recorded only: the original system is not available to try.
0:00 Controls for interactive R charts LivelyR brings R into the world of Lively Web: extending the R packages ggvis and Shiny, and adding JavaScript widgets to set up and control charts drawn by R and rendered through the Vega runtime. 0:30 Linked table and chart A simple table added to Vega highlights probed table rows, scatterplot dots and histogram bars. 0:43 One data set, many histograms On a small data set, the shape of a histogram can change dramatically depending on the chosen bin width and offset. Here, bars that are offset by 0.4 of their width form a gentle curve - whereas at an offset of 0.7, two taller bars stand out. 1:13 Sweeps: layered histograms A sweep over the bin offset gives a layered display of all the results - including tall bars that only appear for some offsets. With that sweep in place, we can adjust bin width - for example, to see whether there's always some offset that leads to tall bars. A search like this would be laborious if each parameter only allowed a single setting. 1:53 Settings that go together The two ends of a movable regression-guess line are independent parameters. A subsidiary plot shows R², which will be at its maximum when the line is at its optimum placement. Creating a sweep for the left end while dragging the right helps us close in on that maximum. Our best-guess result is found to be close to R's calculated regression line. 2:49 Which points make a difference? Shift-click perturbs a point through a standard range. A sweep of perturbations shows that a point at the end moves the regression line a lot, and one near the middle much less. 3:33 Filtering out extremes Limits on each dimension, set from the table's min and max cells, remove data points from the extremes. The restrictions can be suppressed temporarily to compare with the unfiltered chart. 4:11 Rewinding history In any interface with multiple settings it can be hard to remember what settings you have tried. The history list records every manipulation as a sequence of evenly spaced changes, enabling earlier settings to be revisited. 4:30 Item probes An item probe shows how the current chart would look if a parameter that was fixed earlier had instead been given a different value. In this case, probing alternative values of the miles-per-gallon limit is found to have little effect. Why is that? 4:45 Probes with sweeps Setting up a sweep on the horsepower limit helps illustrate why. The sweep colours the range of minimum-horsepower settings, leading to a regression line in each colour. Repeating the miles-per-gallon probe confirms that it is the redder lines - those for which the lowest horsepowers have already been filtered out - that are unaffected by filtering out high miles-per-gallon too. 5:23 The goals for this work Sweep and history features like these could help students when learning about statistical measures and the parameters that control them. They could also be added to online articles - to encourage readers to check for themselves the strength of reported conclusions, and authors to take care when drawing them. A mashup of R, with packages from RStudio (ggvis, Shiny and others), and JavaScript, with the libraries Vega, d3 and Lively Web. This is a shortened cut of a 2014 demo video.
Direction by Amelia McNamara; code by Aran Lunzer and Robert Krahn; support from Bret Victor and Dan Ingalls.
← More things I've built