September 2018
Beginner to intermediate
140 pages
2h 52m
English
In ggplot2, every plot is built up as a layer. Layers are made up of geometric objects (geoms), their statistical transformations (stats), and their thematic aspects. Hence, each plot can be thought of as a separate variable, in and of itself. Aesthetic mappings, defined with aes(), describe how variables are mapped to visual properties, or aesthetics. The following diagram depicts the use of the df and aes functions:

Let's look at an example. We will use the gapminder dataset. You can see the available variables in the following snippet. The dataset has different variables for different countries; for example, gdp_per_capita, Electricity_consumption_per_capita ...
Read now
Unlock full access