Tsallaka zuwa abun ciki
Justice Tech School

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

What does aes map?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.