---
author: "Sean Laverty"
title: "Class 8 notes"
date: "`r Sys.Date()`"
format: html
editor: source
---

## Experiments in `ggplot`?

```{r}
#| label: packages
library(ggplot2)
```


```{r}
#| label: read-mouse
dat <- read.delim("./data/mouse.csv", header = TRUE, sep = ',')
head(dat)
```

Depending on subsequent choice, the `aes(...)` can go in a variety of places in the plotting command.  Below it could go after `dat` in `ggplot()`, it ocould go inside `geom_point()`, or before or after it.  Depending on the placement and additional arguments about aesthetic preferences (e.g., shape, size, linewidth, color, ...), it gives certain plot geometries necessary information or other plot geometries conflicting adn prohibitive information.

```{r}
#| label: fig-gg-scatter
#| fig.width: 5
#| fig.height: 5
#| fig.cap: "A basic scatterplot."
ggplot(dat) + geom_point(aes(x = Mass, y = MetabolicRate))
```
