knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 8,
  fig.height = 5,
  fig.path = "man/figures/README-",
  out.width = "100%"
)

penngradlings - Themes and utilities for Penn GradLingS

R-CMD-check R-CMD-check Codecov test coverage

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("yjunechoe/penngradlings")

Example

library(penngradlings)
library(ggplot2)

ggplot(diamonds, aes(cut, price, fill = cut)) +
  stat_summary(geom = "bar", fun = "mean", width = 0.8) +
  scale_y_continuous(
    expand = expansion(c(0, 0.1)),
    labels = ~ paste0("$", .x)
  ) +
  scale_fill_pgl_discrete(what = "cat_coaster", who = "xin") +
  labs(
    title = "Price of diamonds by cut quality",
    subtitle = "This is a bad plot because carat (size) is a confounding variable",
    x = NULL, y = NULL,
    caption = "diamonds dataset from {ggplot2}"
  ) +
  theme_pgl_minimal(axis_lines = "x", grid_lines = "y")

More on the package website.



yjunechoe/penngradlings documentation built on Sept. 6, 2024, 8:13 p.m.