Francisco Navarro
december 28, 2017
This shiny app let us simulate the following experiment:
The shiny app will draw a histogram showing how many times each result has come out.
library(ggplot2); library(dplyr); my_n = 100; set.seed(2017); my_size = 90; my_prob = 1/6; sample <- rbinom(n=my_n, size=my_size, prob=my_prob)
ggplot() + geom_histogram(aes(x = sample, y = ..count..), color = "white", fill = "orange", binwidth = 1) + labs(title = "Histogram", x="results", y="count")
The shiny app will show the sample mean and, if we require so by checking the correponding checkbox widget, it will also show:
Finally, if we require so by checking the corresponding radio button, theoretical values for mean, standard deviation, skewness and kurtosis will be provided.
The shiny app can be run here:
https://francisconm.shinyapps.io/tossing-a-dice
You can check the code on this github repository: