| sps_iterator | R Documentation |
Create a function that draws new units, one at a time, according to the sequential Poisson method without replacing previously sampled units.
sps_iterator(x, n = 0L, prn = NULL, alpha = 0.001, cutoff = Inf)
x |
|
n |
|
prn |
|
alpha |
|
cutoff |
|
A function that returns the next unit in the sample. It takes a single
argument giving the sentinel value to indicate that there are no units
left to sample (default NULL).
sps() for drawing a sequential Poisson sample.
prn <- runif(5)
s <- sps_iterator(1:5, prn = prn)
s()
s()
s()
# Same as drawing the sample with 3 units.
sps(1:5, 3, prn = prn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.