SRS {spbal} | R Documentation |
Simple random sampling.
Description
This function invokes base::sample() to draw a random sample using a user specified random seed.
Usage
SRS(seed = 511, total_rows = 0, sample_size = 0)
Arguments
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. |
Details
This function was written by Phil Davies.
Value
A random sample.
Examples
# 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)
[Package spbal version 1.0.0 Index]