srs | R Documentation |
Stratified simple random sampling (SRS) using permanent random numbers. Can also be used for non-stratified SRS using a dummy stratum taking the same value for each object.
srs(frame, stratid, nsamp, prn)
frame |
Data frame (or data.table or tibble) containing the elements to sample from. |
stratid |
Variable in |
nsamp |
Variable in |
prn |
Variable in |
A copy of the input sampling frame together with the boolean variable
sampled
, indicating sample inclusion.
prnsamplr, samp, pps, transformprn, ExampleData
dfOut <- srs(
frame = ExampleData,
nsamp = ~nsample,
stratid = ~stratum,
prn = ~rands
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.