Learn R Programming

simFrame (version 0.1.2)

SampleControl: Create objects of class "SampleControl"

Description

Create objects of class "SampleControl".

Usage

SampleControl(...)

Arguments

...
arguments passed to new("SampleControl", ...).

Value

  • An object of class "SampleControl".

See Also

SampleControl

Examples

Run this code
data(eusilc)

## simple random sampling
srsc <- SampleControl(size = 20)
draw(eusilc[, c("id", "eqIncome")], srsc)

## group sampling
gsc <- SampleControl(group = "hid", size = 10)
draw(eusilc[, c("hid", "id", "eqIncome")], gsc)

## stratified sampling
sts <- SampleControl(design = "region", 
    size = c(2, 5, 5, 3, 4, 5, 3, 5, 2))
draw(eusilc[, c("id", "region", "eqIncome")], sts)

Run the code above in your browser using DataLab