ggplot2 03 Individual geoms
In this lecture, you’ll learn how to *think in layers* with **ggplot2**—and how to choose the right **geom** to communicate your data clearly and efficiently. We use a practical, task-based workflow so you can move from “I have data” to “I have a publication-quality plot” with less trial-and-error. ### What you’ll learn * The **three core ingredients** of every ggplot: **data + aesthetics + geoms** * How to design plots using ggplot2’s **layered structure**—and how to decide the purpose of each layer before you add it * A practical framework for building graphics with: * **Data layers** (raw observations), * **Statistical summary layers** (fits/trends/aggregations), and * **Metadata layers** (annotations, context, reference cues) * What most “basic plot types” have in common (typical aesthetics like **x/y**, plus **color/size**, and when **fill** matters) ### Geoms covered (with examples) * **Points & lines:** `geom_point()`, `geom_line()`, `geom_path()`, `geom_segment()` (including how **group** affects what gets connected, plus line-specific aesthetics like **linetype**) * **Bars & areas:** `geom_bar()`, `geom_col()`, `geom_area()` (including default stacking behavior when groups overlap) * **Rectangles & tiles:** `geom_rect()`, `geom_tile()`, `geom_raster()` for heatmaps/image-style plots * **Distributions & summaries:** `geom_boxplot()`, `geom_violin()`, `geom_smooth()` * **Annotations:** `geom_text()` ### Practice (recommended) At the end, you’ll find exercises that reinforce geom selection, the differences between closely related geoms (e.g., `geom_line()` vs `geom_path()`), and how higher-level geoms are constructed from lower-level building blocks. If you’re building skills for analytics, statistics, or data science work, this is the set of ggplot2 fundamentals you’ll reuse constantly. **If this helped:** like, subscribe, and share with someone learning R/ggplot2. Comment with a plot you’re trying to make—I may cover it in a future video. ```text Resources referenced in the lecture notes: - ggplot2 book (online): https://ggplot2-book.org/ - ggplot2 book repository: https://github.com/hadley/ggplot2-book/ ``` #rstats #ggplot2 #datavisualization #datascience #statistics
Download
0 formatsNo download links available.