Created
June 19, 2019 04:27
-
-
Save statwonk/a329f696f2211965e9f0a5cebd2e8970 to your computer and use it in GitHub Desktop.
Part of the Normal family of distributions.
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
library(tidyverse) | |
plot.new() | |
par(bg = "black") | |
plot(density(rnorm(1e6)), col = "deeppink", lwd = 1, | |
xlab = "", ylab = "", main = "Normal distribution", axes = FALSE) | |
seq(1, 10, 0.05) %>% | |
map(function(x){ rnorm(1e5, 0, x)}) %>% | |
map(function(x) { density(x) %>% | |
lines(col = colors() %>% Filter(function(.x) grepl("pink", .x), .) %>% sample(1), | |
lwd = sample(seq(0.1, 0.1, 0.01), 1), | |
lty = 1)}) %>% | |
invisible() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment