Coursera's Developing Data Products course. Course Project: Shiny Application and Reproducible Pitch

Francisco Navarro
december 28, 2017

Slide 2/5

This shiny app let us simulate the following experiment:

  • Activity: rolling a dice 90 times.
  • Measure: counting how many times “6” comes out. At least, we'll count 0 times and, at most, 90 times.
  • Sample size: we'll do the experiment a number of times selected with the slider widget.

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)

Slide 3/5

ggplot() + geom_histogram(aes(x = sample, y = ..count..), color = "white", fill = "orange", binwidth = 1) + labs(title = "Histogram", x="results", y="count")

plot of chunk unnamed-chunk-2

Slide 4/5

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.

Slide 5/5

The shiny app can be run here:

https://francisconm.shinyapps.io/tossing-a-dice

You can check the code on this github repository:

https://github.com/francisconm/tossing-a-dice