ggplot2
is the go-to R package for making beautiful, customizable, and layered graphics. It follows the "Grammar of Graphics" concept.
aes()
to map data columns to aesthetics like x/y, color, size.
ggplot()
- Start a plot with data & aestheticsaes()
- Define mappings (x, y, color, etc.)geom_*
- Add geometric layers (points, bars, lines...)labs()
/ ggtitle()
- Add labels and titlestheme()
- Customize plot appearance