From the course: R: Interactive Visualizations with htmlwidgets

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create interactive stacked bar charts

Create interactive stacked bar charts - R Tutorial

From the course: R: Interactive Visualizations with htmlwidgets

Start my 1-month free trial

Create interactive stacked bar charts

- [Instructor] Bar charts are excellent visualization tools for comparing variables across multiple categories. For instance, you might be interested in visualizing the number of movies in each genre on Netflix. If you have subcategories data, for instance, you break down comedies to include romantic and horror comedies, then stacked bar charts are what you want to use. Highcharter makes it easy to build these charts. Let's see how in the bar-charts.R file. So I'll open that file. I minimize my environment because I don't need it. At the top of the script file, we load the tidyverse library. We Command + Enter. We import our data using read_csv and store it against the gig_economy_data variable. Now on line six through eight, I use two deep prior verbs: first, group_by to group my data by country_group, and then summarize to count the number of rows in each group using the function n and store this data in a new column called jobs.in.country. Let's run this code with Command + Enter…

Contents