Why Virtual Reality in R?

Posted 5 Sep 2018

I recently put together vrrr, a collection of packages built on top of a-frame and AR.js, for virtual and augmented reality in R. They are currently just light wrappers around the core libraries but I hope they will evolve into something more intuitive eventually.

This post aims at answering the simple question: but why?

I had been thinking about using virtual reality for data visualisation purposes for a long time, expecting virtual reality could be a great way to communicate certain measures. Data visualisation generally, has to fit pages or screens and therefore all elements of a visualisation have to be scaled, which might make some things more difficult to communicate. Virtual reality might remedy to some scaling issues, merely because virtual reality does not require scale; we use real world metrics to create real world volumes.

Let’s say we want to communicate to our audience the difference in Growth Domestic Product per capita between Luxembourg and Somalia, the respective largest and lowest in the world according to Wikipedia.

  1. Luxembourg: US$104,803
  2. Somalia: US$92

The most straighforward way to visualise the above is probably with a bar graph.

We can tell the difference is large but it is difficult for the reader to envision that difference. Let’s see what can be done with virtual reality.

Virtual reality uses real-world units, a-frame, upon which vrrr is built, uses actual meters. In our visualisation above we visualise the real difference between the GDP of an average Somalian and that of a citizen of Luxembourg, who, were they to stack their contributions to the GDP would exactly match the visualisation; a one centimeter high pile against an 11 meter pile of US$1, the bars width and depth also respect the dimensions of a dollar bill.

Granted, the above is a very literal, virtual reality enables much more “realistic” visualisations. Perhaps we should use something else than dollars (thinking of something Big Mac Index~ish)

Hopefully, we’ll get to explore more those kinds of visualisations in the future.

Latest package

sigmajs is an R package to interactively visualise networks.

Latest posts

R, limericks, and other indoor stuff.