From the course: R for Data Science: Analysis and Visualization

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Using colors in R

Using colors in R

- [Instructor] Humans are visual animals and one of the best way to communicate information to humans is through visuals and by guiding people through color. So adding color to your charts in R is it going to make a big difference in their effectiveness. Fortunately, there's a lot of different ways to deal with color in R, you've got choices, and I want to discuss some of those things right here. I'm going to start by creating a tiny little data set. I'm simply putting together a few numbers, saving them to X and then I'm going to use the default bar plot command. And when we get to that, here's my chart right down here. There's nothing special right there. I'll zoom in on it a little bit but you can see it's giving us the height of the different bars that I've created. But they're all gray. Now gray's not bad on its own. Gray on white actually works really nicely in a lot of situations, but you have the option of adding a…

Contents