Yihui Xie

sample.cluster()

Demonstration of the cluster sampling

Yihui Xie & Lijia Yu / 2017-04-04


Each rectangle stands for a cluster, and the simple random sampling without replacement is performed for each cluster. All points in the clusters being sampled will be drawn out.

library(animation)
ani.options(nmax = 50)
par(mar = rep(1, 4))
sample.cluster(col = c("bisque", "white"))