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

cookiemonster

The goal of cookiemonster is to add a festive picture of Cookie Monster above a line-up protocol plot, in reference to Graphical inference by Hadley Wickham.

This small package would not have been here without Thomas Lin Pedersen's patchwork.

Installation

This package depends on the development package patchwork which is not yet on CRAN. But can be downloaded from github.

# install.packages("devtools")
devtools::install_github("thomasp85/patchwork")

You can install cookiemonster from github with:

# install.packages("devtools")
devtools::install_github("EmilHvitfeldt/cookiemonster")

Examples

Due to the flexibility of patchwork we are able to use a quite relaxed notation.

library(ggplot2)
library(nullabor)
library(patchwork)
library(cookiemonster)
cookiemonster(data = mtcars, var = "mpg") +
  aes(mpg, wt) +
  geom_point()

cookiemonster(mtcars, aes(mpg, wt), "mpg") +
  geom_point()
library(ggplot2)
library(nullabor)
library(patchwork)
library(cookiemonster)
cookiemonster(mtcars, var = "mpg") +
  aes(mpg, wt) +
  geom_point()

And we can check whether our guess is correct or not

decrypt("WOXC 1IZI Tx t4nTZT4x p")

More examples

cookiemonster(mtcars, var = "cyl", procent = 0.2, n = 15, nrow = 3) +
  geom_boxplot(aes(cyl, mpg, group = cyl))
cookiemonster(mtcars, aes(mpg, wt), "mpg") +
  geom_point() +
  theme_bw() +
  stat_smooth()


EmilHvitfeldt/cookiemonster documentation built on Feb. 4, 2018, 12:01 a.m.