(This article was first published on

**Dan Garmat's Blog -- R**, and kindly contributed to R-bloggers)This code simulates Normal(0,1), and this visualization shows smaller samples can vary much more than large samples from the true distribution. Maybe it’s not a fascinating picture although there is a deep mystery or two in there. Can we know the truth? Isn’t everything we know based on a sample? Is everything we believe, like these three `rnorm()`

, an incomplete story?

```
require(tidyverse)
require(tidyr)
random_simulations_1 <- tibble(rnorm(100000)) %>%
gather %>%
rename(distribution = key, observed = value)
random_simulations_2 <- tibble(rnorm(1000)) %>%
gather %>%
rename(distribution = key, observed = value) %>%
bind_rows(random_simulations_1)
random_simulations <- tibble(rnorm(10)#, rnorm(100)
#runif(100)#,
#rhyper(100, 100, 50, 10),
#rbinom(100, 10, .5)
) %>%
gather %>%
rename(distribution = key, observed = value) %>%
bind_rows(random_simulations_2)
# note we've repeated three times, time for a function
# also note there are other distributions to try this on
# and really, it may ne nice to simulate a few pulls of
# the same size
ggplot(random_simulations, aes(observed,
fill = as.factor(distribution))) +
geom_density(alpha = 0.2) +
labs(title = "Simulate N(0,1)")
```

To

**leave a comment**for the author, please follow the link and comment on their blog:**Dan Garmat's Blog -- R**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...