Learn R Programming

TLBC (version 1.0)

stratSample: Stratified sample

Description

Function to choose a random sample of data stratified by label.

Usage

stratSample(labels, nsamp)

Arguments

labels
Vector of strings denoting labels.
nsamp
Number of items to sample from each label class.

Value

Vector of indices chosen.