| colleyRstats_setup | R Documentation |
Sets ggplot2 themes and conflict preferences to match the standards used in the colleyRstats workflow.
colleyRstats_setup(
set_options = FALSE,
set_theme = TRUE,
set_conflicts = TRUE,
print_citation = TRUE,
verbose = TRUE
)
set_options |
Logical. If |
set_theme |
Logical. If |
set_conflicts |
Logical. If |
print_citation |
Logical. If |
verbose |
Logical. If |
Invisibly returns NULL.
# Runs everywhere, no extra packages, no session side effects
colleyRstats::colleyRstats_setup(
set_options = FALSE,
set_theme = FALSE,
set_conflicts = FALSE,
print_citation = FALSE,
verbose = FALSE
)
# Full setup (requires suggested packages; changes session defaults)
if (requireNamespace("ggplot2", quietly = TRUE) &&
requireNamespace("see", quietly = TRUE)) {
local({
old_theme <- ggplot2::theme_get()
on.exit(ggplot2::theme_set(old_theme), add = TRUE)
colleyRstats::colleyRstats_setup(
set_options = FALSE,
set_conflicts = FALSE, # avoid persisting conflict prefs in checks
print_citation = FALSE,
verbose = TRUE
)
ggplot2::ggplot(mtcars, ggplot2::aes(mpg, wt)) +
ggplot2::geom_point()
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.