Created
September 13, 2021 18:11
-
-
Save orrymr/bab5d7d2bd7f8990c2ce96e9ae263d2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n_ <- 2000 | |
m_ <- 10000 | |
g <- ggplot(roll(m = m_, n = n_), | |
mapping = aes(x = V1)) + | |
geom_vline(xintercept = 3.5, colour = "tomato3") + | |
labs( | |
subtitle = str_interp('Density of means of dice | |
rolls for ${n_} dice over ${m_} rolls.'), | |
x = 'Mean Score', | |
y = 'Proportion of the time the value was observed' | |
) + | |
geom_bar(aes(y = ..prop..), alpha = 0.4) + | |
scale_x_continuous( | |
breaks = 1:6, | |
lim = c(0, 7) | |
) + | |
geom_density() | |
g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment