SRS | R Documentation |
This function invokes base::sample() to draw a random sample using a user specified random seed.
SRS(seed = 511, total_rows = 0, sample_size = 0)
seed |
The random seed to be used to draw the current sample. |
total_rows |
The total number of rows in our input dataset. |
sample_size |
The number of rows wanted in our random sample. |
This function was written by Phil Davies.
A random sample.
# Create a random sample with a seed of 99 ----------------------------------
spbal::SRS(seed = 99, total_rows = 100, sample_size = 20)
# Create a random sample with a seed of 42 ----------------------------------
spbal::SRS(seed = 42, total_rows = 100, sample_size = 20)
# Create a random sample with a seed of 99 ----------------------------------
spbal::SRS(seed = 99, total_rows = 100, sample_size = 25)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.