Description Usage Arguments Details Value Author(s) See Also
Selects a subsample of a data frame where the proportion of points in each class of a set of factor variables in the subset match those of the input data frame.
1 |
data |
The data frame to be subsampled. |
number |
The number of rows of data to be returned, ie. the sample size. |
variables |
A vector containing the names of factor variables to be used in the stratification |
iter |
The number of iterations to try to find the optimal solution. |
This function uses a chi square test to select rows of an input data frame, where the proportion of values falling in classes of multiple factors closely matches the propotion in the input data. For example, you may have a large input data set of geographic points with variables describing soil type or land use. This function returns a subset of the data, of chosen size, the proportion of soil types and land uses matches those of the input data.
This function works only on factors for which a proportion of counts in each class can be calculated. For stratification with continuous variables, use mvcs
.
A data frame.
Grant Williamson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.