Skip to content

Commit bb0393e

Browse files
committed
Several missing words added to vignette
1 parent 88b1451 commit bb0393e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/extending-ggplot2.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ ggplot(mpg, aes(displ, hwy)) +
177177
stat_lm(formula = y ~ poly(x, 10), geom = "point", colour = "red", n = 20)
178178
```
179179

180-
Note that don't _have_ to explicitly include the new parameters in the arguments for the layer, `...` will get passed to the right place anyway. But you'll need to document them somewhere so the user knows about them. Here's a brief example. Note `@inheritParams ggplot2::stat_identity`: that will automatically inherit documentation for all the parameters also defined for `stat_identity()`.
180+
Note that we don't _have_ to explicitly include the new parameters in the arguments for the layer, `...` will get passed to the right place anyway. But you'll need to document them somewhere so the user knows about them. Here's a brief example. Note `@inheritParams ggplot2::stat_identity`: that will automatically inherit documentation for all the parameters also defined for `stat_identity()`.
181181

182182
```{r}
183183
#' @inheritParams ggplot2::stat_identity
@@ -199,7 +199,7 @@ stat_lm <- function(mapping = NULL, data = NULL, geom = "line",
199199

200200
### Picking defaults
201201

202-
Sometimes you have calculations that should performed once for the complete dataset, not once for each group. This is useful for picking sensible default values. For example, if we want to do a density estimate, it's reasonable to pick one bandwidth for the whole plot. The following Stat creates a variation of the `stat_density()` that picks one bandwidth for all groups by choosing the mean of the "best" bandwidth for each group (I have no theoretical justification for this, but it doesn't seem unreasonable).
202+
Sometimes you have calculations that should be performed once for the complete dataset, not once for each group. This is useful for picking sensible default values. For example, if we want to do a density estimate, it's reasonable to pick one bandwidth for the whole plot. The following Stat creates a variation of the `stat_density()` that picks one bandwidth for all groups by choosing the mean of the "best" bandwidth for each group (I have no theoretical justification for this, but it doesn't seem unreasonable).
203203

204204
To do this we override the `setup_params()` method. It's passed the data and a list of params, and returns an updated list.
205205

0 commit comments

Comments
 (0)