Skip to content

Commit 918821a

Browse files
authored
replace confusing wording in vignette (#6075)
1 parent 3be5d6c commit 918821a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

vignettes/ggplot2-in-packages.Rmd

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,11 @@ theme_custom <- function(...) {
194194
mpg_drv_summary() + theme_custom()
195195
```
196196

197-
It is important that the theme be calculated after the package is loaded. If not, the theme object is stored in the compiled bytecode of the built package, which may or may not align with the installed version of ggplot2! If your package has a default theme for its visualizations, the correct way to load it is to have a function that returns the default theme:
197+
It is important that the theme be calculated after the package is loaded. If not, a theme object stored as a variable in the built packagemay or may not align with the installed version of ggplot2! If your package has a default theme for its visualizations, the correct way to apply this theme is by calling the constructor:
198198

199199
```{r}
200-
default_theme <- function() {
201-
theme_custom()
202-
}
203-
204200
mpg_drv_summary2 <- function() {
205-
mpg_drv_summary() + default_theme()
201+
mpg_drv_summary() + theme_custom()
206202
}
207203
```
208204

0 commit comments

Comments
 (0)