Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions layers.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ This call fully specifies the five components to the layer: \index{Layers!compon
If you supply an aesthetic (e.g. colour) as a parameter, it will not be scaled, allowing you to control the appearance of the plot, as described in @sec-setting-mapping.
You can pass params in `...` (in which case stat and geom parameters are automatically teased apart), or in a list passed to `geom_params`.

- **stat**: The name of the statistical tranformation to use.
- **stat**: The name of the statistical transformation to use.
A statistical transformation performs some useful statistical summary, and is key to histograms and smoothers.
To keep the data as is, use the "identity" stat.
Learn more in @sec-stat.
Expand Down Expand Up @@ -258,7 +258,7 @@ It may take some time before the best approach is immediately obvious, so if you

Instead of mapping an aesthetic property to a variable, you can set it to a *single* value by specifying it in the layer parameters.
We **map** an aesthetic to a variable (e.g., `aes(colour = cut)`) or **set** it to a constant (e.g., `colour = "red"`).
If you want appearance to be governed by a variable, put the specification inside `aes()`; if you want override the default size or colour, put the value outside of `aes()`.
If you want appearance to be governed by a variable, put the specification inside `aes()`; if you want to override the default size or colour, put the value outside of `aes()`.
\index{Aesthetics!setting}

The following plots are created with similar code, but have rather different outputs.
Expand Down Expand Up @@ -365,7 +365,7 @@ For example, using a point geom will create a scatterplot, while using a line ge
- `geom_density2d()`: smoothed 2d density estimate.
- `geom_hex()`: bin into hexagons and count.
- At least one discrete:
- `geom_count()`: count number of point at distinct locations
- `geom_count()`: count number of points at distinct locations
- `geom_jitter()`: randomly jitter overlapping points.
- One continuous, one discrete:
- `geom_bar(stat = "identity")`: a bar chart of precomputed summaries.
Expand Down Expand Up @@ -477,7 +477,7 @@ You'll rarely call these functions directly, but they are useful to know about b

Other stats can't be created with a `geom_` function:

- `stat_ecdf()`: compute a empirical cumulative distribution plot.
- `stat_ecdf()`: compute an empirical cumulative distribution plot.
- `stat_function()`: compute y values from a function of x values.
- `stat_summary()`: summarise y values at distinct x values.
- `stat_summary2d()`, `stat_summary_hex()`: summarise binned values.
Expand Down