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.
Deze oefening maakt deel uit van de cursus
Equity Valuation in R
Oefeninstructies
- Use
rbind()to combine the vectorshist_revandrev_projand assign it torev_split. - Rename column headers of
rev_splitfrom 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".
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Combine hist_rev and rev_proj
rev_split <- ___(hist_rev, rev_proj)
# Rename the column headers
___(rev_split) <- seq(2009, 2021, 1)
# Create a bar plot of the data
barplot(rev_split,
col = c("___", "___"),
main = "___")
legend("topleft",
legend = c("Historical", "Projected"),
fill = c("red", "blue"))