Explore aesthetics such as
In this module, we will focus on the aesthetics i.e. color, shape, size, alpha, line type, line width etc. We can map these to variables or specify values for them. If we want to map the above to variables, we have to specify them within the aes()
function. We will look at both methods.
library(ggplot2)
library(dplyr)
library(tidyr)
ggplot(mtcars, aes(x = disp, y = mpg, color = factor(cyl))) +
geom_point()