From the course: R: Interactive Visualizations with htmlwidgets
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Specify your own colors - R Tutorial
From the course: R: Interactive Visualizations with htmlwidgets
Specify your own colors
- [Instructor] There's a certain knack or trick to customizing the colors used in a high charter chart. Let's look at a quick example in our exercise files. Let's open bar chat custom colors. At the top of the script file, we load three libraries that we need: first, the tidyverse library, which we run with Command + Enter, then the highcharter library as these are the charts we're going to create. Now, every time we load the highcharter library we get a message reminding us Highcharts is not free for commercial or governmental use. On Line 3, we'll also load the RColorBrewer library as this gives us access to a very nice color scheme called paired that we're going to use to color our bar charts. On Line 5, we read in a CSV file using read underscore csv and then I'm going to decrease the size of our environment because I don't need it. Lines 8 through 32 used a mutate verb to add two new columns to our data frame. The first is country group color where we map each of the country…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
What is the Highcharter library?7m 29s
-
(Locked)
Create interactive stacked bar charts5m 52s
-
(Locked)
Create interactive scatter charts and bubble charts7m
-
(Locked)
Create interactive time series6m 8s
-
(Locked)
Create interactive treemaps4m 38s
-
(Locked)
Create interactive choropleth maps9m 59s
-
(Locked)
Specify your own colors4m 34s
-
(Locked)
Modify tooltips in Highcharter6m 11s
-
(Locked)
Extract click information from Highcharter9m 27s
-
-
-
-