.sample {MazamaTimeSeries} | R Documentation |
General table row sampling
Description
This is a wrapper around sample
to make it
easy to select random rows from a table. Supports either integer
(sampleSize
) or fractional (sampleFraction
) row sampling.
For reproducible debugging, specify seed
.
If both sampleSize
and sampleFraction
are specified,
sampleSize
takes precedence.
Specifying sampleSize
greater than the number of rows in the
dataframe or sampleFraction > 1
will use all rows.
Usage
.sample(data, sampleSize = NULL, sampleFraction = NULL, seed = NULL)
Arguments
data |
Dataframe to be sampled. |
sampleSize |
Non-negative integer giving the number of rows to choose. |
sampleFraction |
Fraction of rows to sample. |
seed |
Integer passed to |
Value
A data.frame
[Package MazamaTimeSeries version 0.3.1 Index]