ggplot2 Introduction
ggplot2 builds charts from data, aesthetics and layers added with +.
Example
library(ggplot2)
df <- data.frame(x = 1:5, y = c(2, 4, 3, 6, 8))
ggplot(df, aes(x, y)) +
geom_point() +
geom_line() +
labs(title = "Trend")Exercise
Add a layer.
ggplot(df, aes(x, y)) geom_point()
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.