This is a wrapper around sample() to make it easy to select random rows from a table. Supports both integer (sampleSize) and fractional (sampleFraction) N row sampling. For reproducible debugging, set a hash seed.
.sample(data, sampleSize = NULL, sampleFraction = 1, setSeed = NULL)
data | Dataframe to be sampled |
---|---|
sampleSize | a non-negative integer giving the number of rows to choose. |
sampleFraction | the fraction of rows to choose.
|
setSeed | an integer that sets random numbver generation. Can be used to reproduce sampling. |
A data.frame