oopt = ani.options(interval = 1, nmax = 30)
op = par(mar = rep(1, 4))
sample.simple()
par(op)
# HTML animation page
ani.options(ani.height = 350, ani.width = 500, nmax = 30, interval = 1,
title = "Demonstration of the simple random sampling without replacement",
description = "Each member of the population has an equal and known chance
of being selected.")
ani.start()
par(mar = rep(1, 4), lwd = 2)
sample.simple()
ani.stop()
ani.options(oopt)
Run the code above in your browser using DataLab