knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 8, fig.height = 5, fig.path = "man/figures/README-", out.width = "100%" )
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("yjunechoe/penngradlings")
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.