Kickstart 2020 with new opportunities! - hours only!Up to 80% off on all courses and bundles.-Close
1. Bar chart or pie chart?
Check yourself
Extra

Instruction

Great! At this point, we know the pie chart very well. What we don't know is why it creates so much controversy. Let's consider two situations when we should use a bar chart instead of a pie chart.

First, look at how a bar chart will represent our data. In particular, we want to focus on how effective it is at showing the consumption levels of different beverage types. We'll build this chart in the following exercise.

Exercise

Plot a bar chart for france_beverages. Use percent as the y variable and beverage as the x variable. Add a title to the chart and remove the vertical grid.

When you're done, press .

Stuck? Here's a hint!

You should write

ggplot(data = france_beverages, aes(x = beverage, y = percent)) +
geom_col(fill = "steelblue") +
labs(title = "Total alcohol consumption in France by beverage type") +
theme(panel.grid.major.x = element_blank())