Exercise

Analyze Revenue Trends - Bar Chart

One of the simplest but often neglected approaches to check the data is through visual inspection. In this exercise, you will create a bar chart of the revenue projections. Currently, the data is stored into two vectors, hist_rev (historical data) and rev_proj (projected data). We do this so that we can format the bar chart to make clear the distinction between actual revenues versus forecasted revenues.

Instructions

100 XP
  • Use rbind() to combine the vectors hist_rev and rev_proj and assign it to rev_split.
  • Rename column headers of rev_split from 2009 to 2021.
  • Create a bar chart of the data in rev_split, color the bars red and blue, and add the title "Historical vs. Projected Revenues".