stratified_sampling {skm}R Documentation

stratified_sampling

Description

select k elements from vector v w.r.t stratify structure group g. TODO - implementing via template so v is flexible as vec or uvec.

Usage

stratified_sampling(v, k, g)

Arguments

v

<vector> v: a numeric candidate v from which draw sample.

k

<integer> k: selection sample size.

g

<vector> g: stratify structure g - info on grouping of v so that the selected sample is stratified across groups.

Value

s <vector> s: a vector select from v length k stratified by g.

Note

v is required as an integer vector for using in skm


[Package skm version 0.1.5.4 Index]