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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Otherwise a plot named “Rplots.pdf” will be created in the current working directory with a width and height of 7 inches.
- 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.
Several websites, such as http://www.color-hex.com/, provide a quick way of decoding these into a thumbnail of the color.
- 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.
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.
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.
Technically R only has the ability to construct pseudorandom numbers, but conceptually for most purposes the distinction is unimportant.
- 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.
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.
For a good description to many of these additional parameter, see Paul Murrell’s text R graphics [1].
References
Paul Murrell. R graphics. CRC Press, 2011.
Hadley Wickham. ggplot2: elegant graphics for data analysis. Springer Science & Business Media, 2009.
Leland Wilkinson, D Wills, D Rope, A Norton, and R Dubbs. The grammar of graphics. Springer Science & Business Media, 2006.
Author information
Authors and Affiliations
Rights 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
DOI: https://doi.org/10.1007/978-3-319-20702-5_5
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-20701-8
Online ISBN: 978-3-319-20702-5
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)