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.

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