knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-figs/" )
Contains a simple theme for ggplot2, theme_sleek()
, that loosely resembles nicely themed plots (to my taste) from R base graphics. The theme builds on ggplot2::theme_light()
. I may add more ggplot helper functions in the future.
Installing:
# install.packages("devtools") devtools::install_github("seananderson/ggsidekick")
Exciting demo with dataset showing the number of breaks in yarn during weaving for 2 yarn types and 3 tension levels:
set.seed(1)
library(ggsidekick) library(ggplot2) ggplot(warpbreaks, aes(tension, breaks)) + geom_violin(fill = "grey90", col = NA) + geom_jitter(width = 0.1, height = 0, alpha = 0.7) + facet_wrap(~wool) + labs(x = "Tension", y = "Breaks") + theme_sleek() # ggsidekick magic happens here
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.