stratified_sampling {skm} | R Documentation |
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.
stratified_sampling(v, k, g)
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. |
s <vector> s: a vector select from v length k stratified by g.
v is required as an integer vector for using in skm