.randomSampleIndex {PDATK} | R Documentation

## Generate a random sample from each group

### Description

Returns a list of equally size random samples from two or more sample groupings.

### Usage

    .randomSampleIndex(n, labels, groups)

### Arguments

`n` | The sample size
`labels` | A `vector` of the group labels for all rows of the
`groups` | A vector of group labels for the data to sample from
`numSamples` | The number of samples to take

### Value

A subset of your object with n random samples from each group in groups. The number of rows returned will equal the number of groups times the sample size.

[Package PDATK version 1.2.0 Index]