library(ggplot2) library(tidyverse) library(cowplot) source("https://gist.githubusercontent.com/benmarwick/2a1bb0133ff568cbe28d/raw/fb53bd97121f7f9ce947837ef1a4c65a73bffb3f/geom_flat_violin.R")
data <- read.csv("data/roll_data.csv") data$die_combo <- paste0(data$die.1, "+", data$die.2) data$die_combo <- as.factor(data$die_combo) data$die.1 <- as.factor(data$die.1) data$die.2 <- as.factor(data$die.2) data$result <- as.factor(data$value) theme_set(theme_cowplot())
We rolled two twelve-sided dice 100000 times.
ggplot(data=filter(data, die_combo=="12+12"), aes(x=result, color=die_combo, fill=die_combo)) + geom_histogram(stat="count") + facet_wrap(~die_combo, ncol=1) + theme(legend.position="none")