Learn R Programming

sgsR (version 1.5.0)

take_samples: Take Samples Based on Strata

Description

This function takes a data frame of existing data, a data frame of desired sample sizes for each strata, and a strata variable name, and returns a sample of the existing data based on the sample sizes for the specified strata.

Usage

take_samples(existing, toSample, strata)

Value

A data frame containing a sample of the existing data based on the sample sizes for the specified strata.

Arguments

existing

A data frame containing existing data.

toSample

A data frame specifying the desired sample sizes for each strata.

strata

A string specifying the name of the variable used to define strata.