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.
Create interactive stacked bar charts - R Tutorial
From the course: R: Interactive Visualizations with htmlwidgets
Create interactive stacked bar charts
- [Instructor] Bar charts are excellent visualization options for comparing variables across multiple categories. For instance, how many movies are there in each genre on Netflix? If you have sub-categorized data, for instance, within comedies you have romantic comedies, and horror comedies, then stacked bar charts may be what you want. Plotly makes it very easy to build these charts. Let's see how. In our exercise files, we have a file called bar, dash, charts, dot, r. Let's open it up and see what we have here. I'll open this file, I'll minimize the environment because I don't need it for this exercise. Now at the top of our script file, we load the tidyverse library with a function library. If I run this code with command, enter, we can see on the console that each of the main libraries from the tidyverse has been loaded. This includes readr library, which provides us with the read, underscore, csv function that we use on line three, to read in data from the csv file and assign it…
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 Plotly library?9m 50s
-
(Locked)
Make ggplot2 interactive using Plotly7m 27s
-
(Locked)
Create interactive stacked bar charts9m 3s
-
(Locked)
Interactive scatter, line, and bubble charts with Leaflet8m 15s
-
(Locked)
Create interactive maps8m 47s
-
(Locked)
Specify custom colors7m 11s
-
(Locked)
Customize tooltips4m 33s
-
(Locked)
Combine multiple charts7m 18s
-
(Locked)
Extract click information from Plotly6m 22s
-
-
-
-
-