|
2 | 2 | withr::with_preserve_seed({
|
3 | 3 | if (!interactive() || stats::runif(1) > 0.1) return()
|
4 | 4 |
|
5 |
| - tips <- c( |
6 |
| - "RStudio Community is a great place to get help: https://community.rstudio.com/c/tidyverse.", |
7 |
| - "Find out what's changed in ggplot2 at https://github.com/tidyverse/ggplot2/releases.", |
8 |
| - "Use suppressPackageStartupMessages() to eliminate package startup messages.", |
9 |
| - "Need help? Try Stackoverflow: https://stackoverflow.com/tags/ggplot2.", |
10 |
| - "Need help getting started? Try the cookbook for R: http://www.cookbook-r.com/Graphs/", |
11 |
| - "Want to understand how all the pieces fit together? See the R for Data Science book: http://r4ds.had.co.nz/" |
12 |
| - ) |
13 |
| - |
14 |
| - tip <- sample(tips, 1) |
| 5 | + tip <- random_tip() |
15 | 6 | packageStartupMessage(paste(strwrap(tip), collapse = "\n"))
|
16 | 7 | })
|
17 | 8 | }
|
18 | 9 |
|
| 10 | +random_tip <- function() { |
| 11 | + tips <- c( |
| 12 | + "RStudio Community is a great place to get help: https://community.rstudio.com/c/tidyverse", |
| 13 | + "Learn more about the underlying theory at https://ggplot2-book.org/", |
| 14 | + "Keep up to date with changes at https://www.tidyverse.org/blog/", |
| 15 | + "Use suppressPackageStartupMessages() to eliminate package startup messages", |
| 16 | + "Need help? Try Stackoverflow: https://stackoverflow.com/tags/ggplot2", |
| 17 | + "Need help getting started? Try the R Graphics Cookbok: https://r-graphics.org", |
| 18 | + "Want to understand how all the pieces fit together? Read R for Data Science: https://r4ds.had.co.nz/" |
| 19 | + ) |
| 20 | + |
| 21 | + sample(tips, 1) |
| 22 | +} |
| 23 | + |
19 | 24 | # Assigning pathGrob in .onLoad ensures that packages that subclass GeomPolygon
|
20 | 25 | # do not install with error `possible error in 'pathGrob(munched$x, munched$y, ':
|
21 | 26 | # unused argument (pathId = munched$group)` despite the fact that this is correct
|
|
0 commit comments