Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
What we will learn
Know your problem
Know your data
Visualize your data - bar chart
11. Plot the bar chart
Work with your chart
Check yourself

Instruction

Now let's build a bar chart. You've already done this, so we won't go into any explanations here. Remember to remove the vertical grid lines after you have plotted the chart. They are completely redundant here.

Exercise

Create a bar chart for zimbabwe_consumption. Use the year column as the x variable and the consumption column as the y variable. Add the theme() function with the panel.grid.major.x and panel.grid.minor.x elements set to element_blank().

Stuck? Here's a hint!

You should write:

bar <- ggplot(
    data = zimbabwe_consumption, 
    aes(x = year, y = consumption)) + 
  geom_col() + 
  theme(
    panel.grid.major.x = element_blank(), 
    panel.grid.minor.x = element_blank())