Resources

Ian Lyttle | Small Team, Big Value: Using R to Design Visualizations | RStudio (2020)

Many R users can feel isolated due to the prevalence of Python or Tableau at their institutions. This talk will focus on how we use R to develop reference implementations of visualizations (using ggplot2), and to develop corporate-themed color maps (using the colorspace package) to bring value to the entire institution. Color maps can be translated into variety of formats, for Tableau, Qlik Sense, d3, etc., and deployed independently from R. For visualizations, our goal is to translate ggplot2 objects to Vega-Lite specifications, using a package we are developing: ggvega. Vega-Lite visualizations are web-native, and are rendered independently from R. Specifications can be designed to be extensible to new data, allowing them serve as templates, to be deployed and updated for use outside of R. Of course, despite isolation within an institution, our work with the larger R open-source communities provides a foundation on which to build; in fact, we have a lot of company and are having a lot of fun

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

The next inspiration, you're all very familiar with Jenny's keynote this morning. And from her, I'm very inspired by the tooling, and we got a little bit of this this morning, is that she's very good at pointing out how we need to focus on what's important and to work towards good enough.

And I very much like this image. This is from a tweet that she sent out in conjunction with a paper, Good Enough Practices in Data Science, with Greg Wilson and others. And what makes this idea so interesting is that she helps provide the tools to help us focus our ideas. And you may be familiar with the Use This Package. I use it extensively. And then the Happy Git With R, and I think one of the best URL names ever, what they forgot to teach you about RStats.

The third inspiration is, if you were here last year for David Robinson's keynote, this helped to clarify a lot of things for me, is that I suppose I was a lot like Dave, in that I thought that things would become less useful to more useful as the idea became more mature. But in practice, anything that is still on your computer is essentially useless. And anything that is off your computer has got a chance.

anything that is still on your computer is essentially useless. And anything that is off your computer has got a chance.

And so this was a very clarifying idea from Dave that I'm going to try to carry through. And then finally, community. And that R-Ladies has been a great inspiration in how to really set up an effective community. I hope it's okay that I single out Gabriella in this. Perhaps appropriate because we're in San Francisco where she launched it. And now, as I'm sure you know, hundreds of chapters.

And in addition to the great technical exchanges that go on, what benefits me, and certainly I'm not central to this, is that through their amplification of voices and focusing on some very important conversations, it really benefits all of us. So I wanted to point out R-Ladies as a particular inspiration to me.

Designing a categorical color palette

So I'd like to spend the next few minutes going through a particular problem that we're addressing at Schneider. And this is to come up with a categorical color palette. And the challenge is that we have these brand colors that are optimized for marketing, but they're not optimized for data visualization. And as you may know, these are two competing sets of goals here.

And from the data visualization point of view, we want to propose a related categorical palette. And I want to take into account color vision deficiency, yet still remain Schneider-y. And of course, Schneider-y is in the eye of the beholder, and particularly the UI design team who will have the ultimate say on this.

So I'm going to walk you through some of the steps that we went through. So we start out with technique. And as I say, the book offers some useful advice, and Klaus is also one of the contributors to the color space package. And if you go on YouTube and look for the UseR! talks last year, that Akam Xylus had a tremendously useful talk that really helped us get on our way.

And as a bit of a side note, it was at this conference a year ago that I was very fortunate to be sitting beside during a session Carla Scheidegger, who's here this time as well. And during the wee breaks between the presentations, I got a very short course on color theory that was very illuminating. But the upshot of it here is, and Will Chase talked about this a little bit this morning, I'll use slightly different words, is to think in terms of hue, chroma, and luminance rather than red, green, and blue.

And there's all these interesting paths that you can go down. You know, for instance, we start with RGB, hue, chroma, luminance, visible gamut, color vision deficiency, perceptual distance, it just goes on and on. And each of these are super interesting rabbit holes that Hayley and I, we found ourselves lost in them. And it makes for great fun. And at times, you know, I think we felt like this guy. So what we needed is focus.

Tooling and communication

And this is where we come back to this idea of tooling. And that we needed numbers to show perceptual differences. And that we began with the color space package and then we're tuned in to Thomas Lynn Peterson's Farver package, which can be used to quantify differences between colors. And we decided to try to put these together with a set of tools that we could use. And this is available out on GitHub. It's called Paloval, and it's this first sort of mix between color space and Farver. And in the spirit of the FAA certified duct tape that we see here, it's good enough now. I hope to improve it later. But it got us through what we needed to do. It's 70% there.

Then on to communication. We created an internal blog, and then using Distil, and we're lucky enough at Schneider Electric that we have an internal instance of GitHub Enterprise. So a lot of these, this great tooling that the Tidyverse team have built for open source that we can adapt within the company. So we're able to serve this out on GitHub Enterprise. It's a Distil blog, another package from RStudio. And it helps us to get our ideas out there.

And then finally, once we get the ideas out there, we need to seek more opinions, and we need to get new perspectives. So we're building this thing at Schneider Electric. Our term of art at Schneider Electric is a community at work. And the idea is we want it to be by practitioners for practitioners. That if, you know, we don't care what tool you use, we know that we're going to be using all different tools. But if we can meet and discuss what we think about when we create a visualization, this can be a useful thing.

And we also hope that this can be a useful point of contact with the UI design team. So if we come up with recommendations that we hope that all of these different business units can use, that at least we've had a chance to discuss them amongst ourselves. And, you know, first of all, we'll get better ideas. And hopefully this helps to facilitate adoption of the ideas.

Results and broader reflections

So our result is this is our first proposal here. And this takes into account color vision deficiency. It's potentially Schneider-y. And we've had some useful feedback, and I'll share some of it with you as I think we'll... I'm not sure how well it's showing up on these screens, but we may in fact remove the reds. Because for some color vision deficient folks, it was difficult to tell apart from the purples. And as I'm learning that red can be a very useful color but can sometimes convey a sentiment that you're not intending to convey.

And with a categorical color palette, unless you want to say that something is... really requires your attention, we might go with something that's more neutral. But the thing here is that we designed this using R, but the thing that we deliver are the hex codes. And that the rest of Schneider, as long as it works, perhaps aren't terribly concerned that we used R, but that what we do deliver, that these hex codes can be useful in all of these different tools that then get used in front of the customers.

So I'd like to spend a... just to sort of wrap up with the... with some ideas of other things that I was thinking of putting in this talk, but didn't make it into the talk, so I call it more broadly, is that under technique, I'm very much like this idea of the grammar of graphics as a description as well as a tool. And it's got this very handy implementation that will build your chart for you, but for me, it helps to focus my thinking and it helps me to be able to describe in very clear terms to somebody who's using their own tool, map this variable to the x-axis, map this variable to your fill color, so on and so forth, use this type of scale.

And this is just another way that Klaus's book has been tremendously useful to us. In terms of tooling, interactivity is something that we're interested in and certainly in front of our customer that we're using interactive tools, and we're very interested in Vega-Lite. And indeed, right now, there's a talk by Alicia Shep, who's doing some super cool stuff to build Vega-Lite specs, so please make sure you get a chance to watch that when the videos are released, as well as Dewey Dunnington, who's talking about ggplot2, so I really wish I could have been in four places at once right now.

But Alicia and I, we have an organization on GitHub on VegaWidget, which provides some tools if you're interested in Vega-Lite and interactive visualization, some first steps towards that. With communication, just to reiterate, move things off of your computer, get them into the world. So nothing terribly new there.

But this one is, I think this is my secret, this has been the secret to a lot of my success and enjoyment of my job over the past six or seven years, is to get to know a local university. I am tremendously lucky that I work in Iowa, and I'm able to visit Iowa State every so often and work with Heike Hoffman. And this has led us to hire some interns, one of whom is here. I'm very glad to see her.

I think this is my secret, this has been the secret to a lot of my success and enjoyment of my job over the past six or seven years, is to get to know a local university.

As well, that led to being able to sponsor Haley as a PhD student. So if you have a chance to get to know a local university, maybe you run into somebody here, I find that this is a way to continue the spirit of this conference throughout the rest of the year.

So with that, I'm happy to yield back the floor to Fareed. Thank you very much. Some links that may be useful, and thank you very much.

Q&A

So we have a couple of minutes for questions. Let me just check our Slido. And if you haven't submitted, you are welcome to stand up and ask a question as well. One question is, it sounds like our team ended up leading the charge for something that is going to benefit the entire organization, a huge organization. Why do you think your team ended up with this opportunity slash responsibility, and what do you think made you successful in the end?

I think we're in the right place. We're a central organization, because each business is quite rightly interested in their success, and the success of their customers. One of our charters as a group is to try to get all the, to address the interests that are common to all the businesses. So I think we're in a good position to do that.

And this has been a first step. I hope to report back at some point with all of the other recommendations that we'll have made. But a lot of the time that we had spent last year was really getting our ducks in a row and thinking about things like communication and community and essentially the four points that I brought up through the slides.