Skip to main content

EDA III: Advanced Graphics

  • Chapter
Humanities Data in R

Abstract

In this chapter, we show several methods for increasing the usability and aesthetic quality of graphics in R. Random number generators and color spaces are also introduced as tools for creating quality graphics.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 99.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Otherwise a plot named “Rplots.pdf” will be created in the current working directory with a width and height of 7 inches.

  2. 2.

    The device should also close if you exit the R session entirely, but it is a better practice to manually close it so as to not risk corrupting the file.

  3. 3.

    Several websites, such as http://www.color-hex.com/, provide a quick way of decoding these into a thumbnail of the color.

  4. 4.

    The coloring is determined entirely by the other two axes, so this works great as an example of what a sequential palette of heat colors looks like. It does not, however, provide much useful new information to the scatter plot.

  5. 5.

    We are implicitly assuming that voters for the front-runners are not changing their votes and that the exact same group of people vote in each round.

  6. 6.

    In this particular case hand constructing colors may be a better alternative as we could pick those associated with each party. We use the colorspace function to illustrate the more general approach.

  7. 7.

    Technically R only has the ability to construct pseudorandom numbers, but conceptually for most purposes the distinction is unimportant.

  8. 8.

    If this scheme seems confusing, try running the code yourself and tweaking the 2 and 10 values. It is significantly easy to describe this in code and examples than via a textual description.

  9. 9.

    If sample is used without a sample size, it returns a random permutation of the entire input. This is the same as would occur when the sample size is manually set to the length of the input.

  10. 10.

    For a good description to many of these additional parameter, see Paul Murrell’s text R graphics [1].

References

  1. Paul Murrell. R graphics. CRC Press, 2011.

    Google Scholar 

  2. Hadley Wickham. ggplot2: elegant graphics for data analysis. Springer Science & Business Media, 2009.

    Google Scholar 

  3. Leland Wilkinson, D Wills, D Rope, A Norton, and R Dubbs. The grammar of graphics. Springer Science & Business Media, 2006.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Arnold, T., Tilton, L. (2015). EDA III: Advanced Graphics. In: Humanities Data in R. Quantitative Methods in the Humanities and Social Sciences. Springer, Cham. https://doi.org/10.1007/978-3-319-20702-5_5

Download citation

Publish with us

Policies and ethics