Learn R Programming

colleyRstats (version 0.0.1)

colleyRstats_setup: Configure Global R Environment for colleyRstats

Description

Sets ggplot2 themes and conflict preferences to match the standards used in the colleyRstats workflow.

Usage

colleyRstats_setup(
  set_options = TRUE,
  set_theme = TRUE,
  set_conflicts = TRUE,
  print_citation = TRUE,
  verbose = TRUE
)

Value

Invisibly returns NULL.

Arguments

set_options

Logical. If TRUE, prints a notice that global options are no longer changed automatically. Default is TRUE.

set_theme

Logical. If TRUE, sets the default ggplot2 theme to see::theme_lucid with custom modifications. Default is TRUE.

set_conflicts

Logical. If TRUE, sets conflicted preferences to favor dplyr and other tidyverse packages. Default is TRUE.

print_citation

Logical. If TRUE, prints the citation information for this package. Default is TRUE.

verbose

Logical. If TRUE, emit informational messages. Default is TRUE.

Examples

Run this code
# 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
)

# \donttest{
# 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()
  })
}
# }

Run the code above in your browser using DataLab