Book Image

ggplot2 Essentials

By : Donato Teutonico
Book Image

ggplot2 Essentials

By: Donato Teutonico

Overview of this book

Table of Contents (14 chapters)
ggplot2 Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Advanced aesthetic mapping


In ggplot2, you have already seen how important the role played by aesthetic mapping is. You have the possibility of applying a very sophisticated and personalized scheme of aesthetic mapping in order to represent data or calculate statistical transformations based on the value of a variable used as a flagging factor. In the following sections, we will go through the different options of aesthetic mapping available and how they can be combined in your plot. For most of the examples, we will simply create small datasets by simulating random variables since, for the time being, we are just looking at the different mapping options for the data.

Typical aesthetic mappings available in ggplot2

You have already seen that the most relevant function used when applying aesthetic mapping is the aes() function. Leaving aside the mapping of the x and y variables, which were already covered in the previous chapter, we will now focus on the other mapping options. The most useful...