Chapter 9. Briefing the Generals

In Chapter 8, we explored several graphics that can be generated in R. Using these visualizations, you were able to win the favor of the Shu Emperor and receive his approval to carry out your battle plans. Now your focus has turned to the Shu generals, who must be convinced that your plan is worthy of their services. The generals will need to know the details of the attack and how it compares with alternative combat strategies. Recruiting the top generals in the Shu army is critical to the success of your strategy. This challenge calls for clean, detailed, and informative graphics.

We will revisit the charts, graphs, and plots that were created in Chapter 8. To improve their informativeness, clarity, and aesthetics, we will employ new graphics arguments and functions. Specific customization arguments for the different graphics types will be deployed. New graphics functions that add information to visuals will also be explored. We will even work to create our own custom graphics from scratch.

By the end of this chapter, you will be able to do the following:

  • Customize several charts, graphs, and plots using arguments specific to each
  • Use graphics functions to add information to any visual
  • Create custom graphics by building them from the ground up

More charts, graphs, and plots in R

In Chapter 8, we customized our graphics using universal arguments that applied to all visuals. However, R graphics often have arguments that apply only to themselves as well. These can be used to make type-specific customizations. We will build upon the graphics that were covered in Chapter 8 by examining the arguments that are specific to each visual. R also provides graphics functions that can be used to add information to any visual. We will use these to expand our graphics and to experiment with building our own graphics from scratch. The following visuals will be covered in this chapter:

  • Bar graphs
  • Scatterplots
  • Line charts
  • Box plots
  • Histograms
  • Pie charts
  • Custom graphics

For demonstration purposes, all of our visuals will communicate information about the fire attack strategy that was used in Chapter 7. This strategy entailed deploying 2,500 Shu soldiers for 7 days to execute a fire attack 225 miles away on 10,000 Wei soldiers in Anding. If desired, you are encouraged to substitute your own battle plans into any or all activities for this chapter.

Throughout this chapter, we will modify and build upon the graphics that we created in the previous chapter. All of the necessary variables from that chapter are provided in the rBeginnersGuide_Ch_09_ReadersCopy.RData workspace file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.73.102