set.seed(123)
ani.options(nmax = 200 + 15 -2, interval = 0.03)
freq = quincunx(balls = 200, col.balls = rainbow(200))
# frequency table
barplot(freq, space = 0)
ani.options(ani.height = 500, ani.width = 600,
interval = 0.03, nmax = 213, title = "Demonstration of the Galton Box",
description = "Balls falling through pins will show you the Normal
distribution.")
ani.start()
quincunx()
ani.stop()
Run the code above in your browser using DataLab