Skip to contents

Given some samples it distribute them in several batches, trying to have equal number of samples per batch. It can handle both numeric and categorical data.

Usage

design(pheno, size_subset, omit = NULL, iterations = 500, name = "SubSet")

Arguments

pheno

Data.frame with the sample information.

size_subset

Numeric value of the number of sample per batch.

omit

Name of the columns of the pheno that will be omitted.

iterations

Numeric value of iterations that will be performed.

name

A character used to name the subsets, either a single one or a vector the same size as n.

Value

The indices of which samples go with which batch.

See also

The evaluate_* functions and create_subset().

Examples

data(survey, package = "MASS")
index <- design(survey[, c("Sex", "Smoke", "Age")], size_subset = 50,
                iterations = 10)
#> Warning: There might be some problems with the data use check_data().
index
#> $SubSet1
#>  [1]   1   7   8  10  14  15  17  24  52  60  63  65  68  69  78  81  83  84  86
#> [20]  91  92  97 100 111 119 120 125 129 131 152 161 165 167 173 177 179 190 191
#> [39] 199 200 208 218 220 229 234 235 236 237
#> 
#> $SubSet2
#>  [1]  18  31  33  43  48  50  55  61  64  71  90  94  95 102 107 114 115 123 128
#> [20] 133 136 137 145 147 148 149 150 159 162 164 168 169 170 176 180 189 198 201
#> [39] 203 205 206 211 212 221 223 225 226 232
#> 
#> $SubSet3
#>  [1]   6  12  13  16  20  26  28  32  34  35  36  38  45  47  56  70  74  79  87
#> [20]  89  96  99 104 105 106 108 112 113 116 126 127 130 132 135 142 153 154 157
#> [39] 178 183 186 196 204 215 219 222 227
#> 
#> $SubSet4
#>  [1]   4   5  11  21  25  30  39  41  44  46  51  58  67  72  73  75  76  82  85
#> [20]  88  93 109 110 117 121 138 141 144 155 158 166 172 181 182 184 185 188 194
#> [39] 202 209 213 214 216 217 228 230 233
#> 
#> $SubSet5
#>  [1]   2   3   9  19  22  23  27  29  37  40  42  49  53  54  57  59  62  66  77
#> [20]  80  98 101 103 118 122 124 134 139 140 143 146 151 156 160 163 171 174 175
#> [39] 187 192 193 195 197 207 210 224 231
#>