Learn R Programming

animation (version 0.2-0)

sample.cluster: Demonstration for cluster sampling

Description

Every 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.

Usage

sample.cluster(pop = ceiling(10 * runif(10, 0.2, 1)), 
    size = 3, control = ani.control(interval = 0.2), ...)

Arguments

pop
a vector for the size of each cluster in the population.
size
the number of clusters to be drawn out.
control
control parameters for the animation; see ani.control
...
other arguments passed to ani.control

Value

  • None (invisible `NULL').

References

Cochran, W G (1977) Sampling Techniques, Wiley, ISBN 0-471-16240-X

See Also

sample

Examples

Run this code
sample.cluster()

# HTML animation page
ani.start()
sample.cluster(pop = sample(15, 5), size = 2, saveANI = TRUE)
ani.stop()

Run the code above in your browser using DataLab