oopt = ani.options(interval = 1, nmax = 30)
op = par(mar = rep(1, 4))
sample.cluster(col = c("bisque", "white"))
par(op)
# HTML animation page
ani.options(ani.height = 350, ani.width = 500, nmax = 30,
interval = 1, title = "Demonstration of the cluster sampling",
description = "Once a cluster is sampled, all its elements will be
chosen.")
ani.start()
par(mar = rep(1, 4), lwd = 2)
sample.cluster(col = c("bisque", "white"))
ani.stop()
ani.options(oopt)
Run the code above in your browser using DataLab