diff --git a/dev/CODE_OF_CONDUCT.html b/dev/CODE_OF_CONDUCT.html index 9ec48a1..1f774d3 100644 --- a/dev/CODE_OF_CONDUCT.html +++ b/dev/CODE_OF_CONDUCT.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/LICENSE-text.html b/dev/LICENSE-text.html index 045559e..14ef452 100644 --- a/dev/LICENSE-text.html +++ b/dev/LICENSE-text.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/LICENSE.html b/dev/LICENSE.html index fb1f545..1316eeb 100644 --- a/dev/LICENSE.html +++ b/dev/LICENSE.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/articles/experdesign.html b/dev/articles/experdesign.html index 2d362dd..9a0f571 100644 --- a/dev/articles/experdesign.html +++ b/dev/articles/experdesign.html @@ -30,7 +30,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 @@ -85,7 +85,7 @@ Releases Lluís Revilla Sancho - 2024-04-30 + 2024-05-07 Source: vignettes/experdesign.Rmd experdesign.Rmd @@ -268,22 +268,28 @@ Layout spati <- spatial(repli, metadata, rows = LETTERS[1:6], columns = 1:4) head(spati) ## $A1 -## [1] 21 5 11 +## SubSet1 SubSet2 SubSet3 +## 32 43 56 ## ## $B1 -## NULL +## SubSet1 SubSet2 SubSet3 +## 3 37 27 ## ## $C1 -## [1] 58 13 33 +## SubSet1 SubSet2 SubSet3 +## 34 29 28 ## ## $D1 -## [1] 35 +## SubSet1 SubSet2 SubSet3 +## 36 5 60 ## ## $E1 -## [1] 3 8 15 +## SubSet1 SubSet2 SubSet3 +## 52 13 33 ## ## $F1 -## [1] 9 19 53 +## SubSet1 SubSet2 SubSet3 +## 39 7 53 Report for easy on field usage @@ -295,12 +301,12 @@ Report for easy on field usagereport2 <- inspect(spati, report, index_name = "position") head(report2) ## height weight sex batch position -## 1 60 100 Male SubSet3 A1 -## 2 65 100 Male SubSet3 A1 -## 3 70 100 Male SubSet1 A1 -## 4 75 100 Male SubSet2 C1 -## 5 80 100 Male SubSet2 C1 -## 6 60 150 Male SubSet3 C1 +## 1 60 100 Male SubSet3 E2 +## 2 65 100 Male SubSet3 D2 +## 3 70 100 Male SubSet1 B1 +## 4 75 100 Male SubSet2 E3 +## 5 80 100 Male SubSet2 D1 +## 6 60 150 Male SubSet3 B2 And now we can see the batch and position of each sample @@ -311,10 +317,10 @@ Compare indicesdesi2 <- create_subset(nrow(metadata), size_batch) compare_index(metadata, desi, desi2) ## subgroups -## SubSet1 SubSet2 SubSet3 -## height -0.003378784 -0.4899827 -1.3652524 -## weight -5.083194894 -5.0202051 -12.6611209 -## sex 0.085527089 0.1267009 0.1152791 +## SubSet1 SubSet2 SubSet3 +## height 0.21717472 0.30918015 -0.008630805 +## weight -3.20170175 -3.83581391 -11.626327348 +## sex -0.00669491 0.00669491 -0.011421802 As many of the variables for multiple subsets are negative it shows that desi is better. @@ -345,7 +351,7 @@ Unbalanced setting# Mean entropy en each subset rowMeans(evaluation["entropy", , ]) ## Classroom Sex Age mix_cat -## 0.98906095 0.05047991 0.00000000 0.96130358 +## 0.96035770 0.05303319 0.00000000 0.93994182 # Original entropy on the dataset evaluate_orig(unbalanced)["entropy", ] ## Warning in evaluate_orig(unbalanced): There might be some problems with the @@ -355,7 +361,7 @@ Unbalanced setting# Dispersion of the entropy apply(evaluation["entropy", , ], 1, sd) ## Classroom Sex Age mix_cat -## 0.01057627 0.13355727 0.00000000 0.08171973 +## 0.05017590 0.14031263 0.00000000 0.07994645 We can see that in this simple case where a single variable has all the other cases we approximately reached the same entropy levels. @@ -384,27 +390,27 @@ Quality checksamples <- extreme_cases(survey, size = 10) survey[samples, ] ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I -## 41 Female 17.5 16.0 Right L on R NA Right Some Never 169.00 Metric -## 52 Male 20.5 20.0 Right L on R 68 Right Freq Never 190.00 Metric -## 76 Female 17.5 17.5 Right Neither 68 Right Freq Heavy 170.00 Metric -## 82 Male 19.2 18.9 Right R on L 76 Right Freq Never 176.50 Imperial -## 93 Female 18.2 17.5 Right L on R 70 Right Some Never 165.00 Metric -## 137 <NA> 19.8 19.0 Left L on R 73 Neither Freq Never 172.00 Metric -## 139 Male 20.0 19.5 Right L on R NA Right Freq Never 170.00 Metric -## 142 Female 18.3 19.0 Right R on L NA Right None Never 165.00 Metric -## 154 Male 21.5 21.6 Right R on L 69 Right Freq Never 172.72 Imperial -## 221 Male 23.2 23.3 Right L on R NA Right None Heavy 171.00 Metric +## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric +## 9 Male 20.0 19.5 Right R on L 72 Right Some Never 175.00 Metric +## 84 Female 17.0 17.4 Right R on L NA Neither Some Never NA <NA> +## 99 Male 19.5 19.4 Right Neither NA Right Freq Never 165.00 Metric +## 107 Female 16.2 16.4 Right R on L NA Right Freq Occas 172.00 Metric +## 171 Female 16.5 17.0 Right L on R NA Right Some Never 168.00 Metric +## 177 Male 20.5 20.5 Right Neither 76 Right Freq Regul 172.72 Imperial +## 191 Male 20.0 19.5 Right R on L 92 Right Some Never 179.10 Imperial +## 201 Female 16.2 15.8 Right R on L 61 Right Some Occas 167.00 Metric +## 202 Male 21.0 21.0 Right L on R 48 Neither Freq Never 174.00 Metric ## Age -## 41 17.500 -## 52 17.500 -## 76 20.667 -## 82 20.167 -## 93 19.667 -## 137 21.500 -## 139 21.417 -## 142 21.083 -## 154 70.417 -## 221 20.917 +## 5 23.667 +## 9 19.000 +## 84 17.167 +## 99 18.083 +## 107 17.000 +## 171 73.000 +## 177 36.583 +## 191 18.917 +## 201 19.250 +## 202 21.333 You can also test a given index with check_index(): check_index(unbalanced, i) @@ -412,15 +418,15 @@ Quality check## data use check_data(). ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 SubSet6 -## Classroom 0.02244529 0.03105896 0.02629978 0.02137583 0.02137583 0.02629978 -## Sex 0.16047517 0.22439953 0.16047517 0.16047517 0.16047517 0.16047517 -## Age 0.42561876 0.23886131 0.43542914 0.19353035 0.12717736 0.34552062 -## mix_cat 0.08031059 0.02527493 0.07741971 0.08111268 0.08111268 0.07741971 +## Classroom 0.02116629 0.02116629 0.04000152 0.04000152 0.06572331 0.02009684 +## Sex 0.17853702 0.17853702 0.24841904 0.17853702 0.17853702 0.17853702 +## Age 0.20351157 0.19733814 0.25375813 0.28706685 0.12655149 0.14621487 +## mix_cat 0.08031059 0.08031059 0.03045638 0.06618417 0.04689282 0.08111268 ## subgroups ## SubSet7 -## Classroom 0.02629978 -## Sex 0.16047517 -## Age 0.25569779 +## Classroom 0.02502079 +## Sex 0.17853702 +## Age 0.45676502 ## mix_cat 0.07741971 Each row has information about how accurate is a given variable to the samples available (on this case unbalanced). Some @@ -457,28 +463,28 @@ Internalsindex <- create_subset(nrow(survey), size_subset = 70) index ## $SubSet1 -## [1] 6 13 14 15 16 17 20 26 32 34 37 47 48 51 53 56 58 59 63 -## [20] 64 67 75 77 79 80 81 85 95 102 108 111 114 115 118 119 126 130 131 -## [39] 134 136 154 156 161 180 182 183 189 192 194 202 203 209 210 211 214 224 225 -## [58] 228 229 236 +## [1] 9 12 21 25 34 37 43 47 58 59 65 67 68 73 74 77 79 80 103 +## [20] 104 113 120 136 140 142 143 144 148 152 153 162 164 165 170 172 173 174 176 +## [39] 178 181 182 185 189 190 192 194 197 202 203 205 208 214 215 217 219 221 224 +## [58] 231 235 237 ## ## $SubSet2 -## [1] 3 4 5 8 12 19 22 24 25 28 31 38 45 46 66 68 70 72 78 -## [20] 82 87 91 97 98 104 106 107 112 121 128 129 141 142 149 150 152 153 159 -## [39] 163 165 166 167 174 176 184 188 190 191 195 198 212 216 219 221 223 231 232 -## [58] 234 237 +## [1] 1 2 7 8 22 23 29 30 33 36 39 42 45 46 51 54 55 64 71 +## [20] 75 76 91 102 105 109 111 114 115 117 118 119 123 125 128 132 135 138 154 +## [39] 155 159 167 177 187 191 193 195 196 198 200 201 207 211 212 218 222 227 228 +## [58] 230 233 ## ## $SubSet3 -## [1] 2 7 10 23 27 30 33 39 42 49 52 60 61 62 69 71 73 74 86 -## [20] 88 89 90 94 103 109 113 116 117 123 132 133 135 140 146 151 157 158 160 -## [39] 169 171 172 173 175 181 185 187 199 205 206 207 208 213 215 217 222 226 227 -## [58] 230 235 +## [1] 3 4 11 13 14 15 18 19 20 24 28 31 32 35 41 48 49 50 52 +## [20] 70 72 81 84 85 86 87 92 93 94 98 112 121 122 124 126 127 129 130 +## [39] 134 137 139 141 147 151 157 158 161 168 171 179 183 199 204 210 213 220 223 +## [58] 225 234 ## ## $SubSet4 -## [1] 1 9 11 18 21 29 35 36 40 41 43 44 50 54 55 57 65 76 83 -## [20] 84 92 93 96 99 100 101 105 110 120 122 124 125 127 137 138 139 143 144 -## [39] 145 147 148 155 162 164 168 170 177 178 179 186 193 196 197 200 201 204 218 -## [58] 220 233 +## [1] 5 6 10 16 17 26 27 38 40 44 53 56 57 60 61 62 63 66 69 +## [20] 78 82 83 88 89 90 95 96 97 99 100 101 106 107 108 110 116 131 133 +## [39] 145 146 149 150 156 160 163 166 169 175 180 184 186 188 206 209 216 226 229 +## [58] 232 236 We can measure how does this index does: score_index1 <- check_index(survey[, keep], index) @@ -487,11 +493,11 @@ Internalsscore_index1 ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 -## Sex 0.183272313 0.18307418 0.18473404 0.34995773 -## W.Hnd 0.201330461 0.38189871 0.16814879 0.16765764 -## Smoke 0.384839974 0.51271703 0.34958370 0.36736401 -## Age 0.247117147 0.86678868 0.69125158 0.51061368 -## mix_cat 0.006173258 0.01392375 0.01709306 0.03849348 +## Sex 0.285472670 0.28479310 0.45087536 0.28479310 +## W.Hnd 0.406863574 0.56967175 0.38262251 0.38311366 +## Smoke 0.352226528 0.35423141 0.51717322 0.36004142 +## Age 0.966161840 0.88451852 0.78376910 1.52773530 +## mix_cat 0.009637159 0.02713277 0.02836273 0.00787233 These values come from calculating the difference between the original data and the samples for each subset for the median, mean, mad, NA, entropy and independence (chisq.test() p.value). @@ -505,7 +511,7 @@ Internals## Warning in check_index(survey[, keep], index2): There might be some problems ## with the data use check_data(). sum(rowMeans(abs(score_index2-score_index1))) -## [1] 0.9367265 +## [1] 0.8869192 If this score is lower than the previous one the new index is kept. This is done similarly for the spatial search, which adds two new @@ -538,12 +544,12 @@ SessionInfo## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: -## [1] experDesign_0.3.0.9001 +## [1] experDesign_0.3.0.9002 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.46 rlang_1.1.3 ## [5] xfun_0.43 purrr_1.0.2 textshaping_0.3.7 jsonlite_1.8.8 -## [9] htmltools_0.5.8.1 ragg_1.3.0 sass_0.4.9 rmarkdown_2.26 +## [9] htmltools_0.5.8.1 ragg_1.3.1 sass_0.4.9 rmarkdown_2.26 ## [13] evaluate_0.23 jquerylib_0.1.4 fastmap_1.1.1 yaml_2.3.8 ## [17] lifecycle_1.0.4 memoise_2.0.1 compiler_4.4.0 fs_1.6.4 ## [21] systemfonts_1.0.6 digest_0.6.35 R6_2.5.1 magrittr_2.0.3 diff --git a/dev/articles/index.html b/dev/articles/index.html index 8c6bb4b..17939fe 100644 --- a/dev/articles/index.html +++ b/dev/articles/index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/authors.html b/dev/authors.html index f3d1040..b20db31 100644 --- a/dev/authors.html +++ b/dev/authors.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 @@ -78,12 +78,12 @@ Citation Revilla Sancho L (????). experDesign: Design Experiments for Batches. -R package version 0.3.0.9001, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. +R package version 0.3.0.9002, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. @Manual{, title = {experDesign: Design Experiments for Batches}, author = {Lluís {Revilla Sancho}}, - note = {R package version 0.3.0.9001, https://github.com/llrs/experDesign/}, + note = {R package version 0.3.0.9002, https://github.com/llrs/experDesign/}, url = {https://experdesign.llrs.dev}, } Revilla Sancho L, Lozano J, Salas Martinez A (2021). diff --git a/dev/index.html b/dev/index.html index c022a17..5078f33 100644 --- a/dev/index.html +++ b/dev/index.html @@ -30,7 +30,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/news/index.html b/dev/news/index.html index 2f79dee..7449385 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 11c6b5a..4af69b5 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.9 pkgdown_sha: ~ articles: experdesign: experdesign.html -last_built: 2024-04-30T09:35Z +last_built: 2024-05-07T16:25Z urls: reference: https://experdesign.llrs.dev/reference article: https://experdesign.llrs.dev/articles diff --git a/dev/reference/batch_names.html b/dev/reference/batch_names.html index a268cce..97a63a4 100644 --- a/dev/reference/batch_names.html +++ b/dev/reference/batch_names.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/check_data.html b/dev/reference/check_data.html index a5d968c..8a9a0a0 100644 --- a/dev/reference/check_data.html +++ b/dev/reference/check_data.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/check_index.html b/dev/reference/check_index.html index 1328851..39fcc20 100644 --- a/dev/reference/check_index.html +++ b/dev/reference/check_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/compare_index.html b/dev/reference/compare_index.html index ba4d9a2..212e1b6 100644 --- a/dev/reference/compare_index.html +++ b/dev/reference/compare_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/create_subset.html b/dev/reference/create_subset.html index 8639455..2f3259b 100644 --- a/dev/reference/create_subset.html +++ b/dev/reference/create_subset.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/design.html b/dev/reference/design.html index d3b9cce..b16f607 100644 --- a/dev/reference/design.html +++ b/dev/reference/design.html @@ -14,7 +14,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/distribution.html b/dev/reference/distribution.html index 63ffa22..4033da7 100644 --- a/dev/reference/distribution.html +++ b/dev/reference/distribution.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/entropy.html b/dev/reference/entropy.html index b55b565..f1e4bea 100644 --- a/dev/reference/entropy.html +++ b/dev/reference/entropy.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_entropy.html b/dev/reference/evaluate_entropy.html index 31c7447..2b46129 100644 --- a/dev/reference/evaluate_entropy.html +++ b/dev/reference/evaluate_entropy.html @@ -16,7 +16,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_independence.html b/dev/reference/evaluate_independence.html index 8ef844f..0b3e2d0 100644 --- a/dev/reference/evaluate_independence.html +++ b/dev/reference/evaluate_independence.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_index.html b/dev/reference/evaluate_index.html index e8b05ca..87b4368 100644 --- a/dev/reference/evaluate_index.html +++ b/dev/reference/evaluate_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_mad.html b/dev/reference/evaluate_mad.html index b8be2c7..b29ae62 100644 --- a/dev/reference/evaluate_mad.html +++ b/dev/reference/evaluate_mad.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_mean.html b/dev/reference/evaluate_mean.html index db61515..67f78f5 100644 --- a/dev/reference/evaluate_mean.html +++ b/dev/reference/evaluate_mean.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_na.html b/dev/reference/evaluate_na.html index de11ea0..c717283 100644 --- a/dev/reference/evaluate_na.html +++ b/dev/reference/evaluate_na.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_orig.html b/dev/reference/evaluate_orig.html index fb0ab10..dd2667f 100644 --- a/dev/reference/evaluate_orig.html +++ b/dev/reference/evaluate_orig.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_sd.html b/dev/reference/evaluate_sd.html index 160a83f..4461588 100644 --- a/dev/reference/evaluate_sd.html +++ b/dev/reference/evaluate_sd.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/experDesign-package.html b/dev/reference/experDesign-package.html index c49a3b6..2080808 100644 --- a/dev/reference/experDesign-package.html +++ b/dev/reference/experDesign-package.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/extreme_cases.html b/dev/reference/extreme_cases.html index 0870b20..730848c 100644 --- a/dev/reference/extreme_cases.html +++ b/dev/reference/extreme_cases.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/follow_up.html b/dev/reference/follow_up.html index 4b409a7..bc65c2e 100644 --- a/dev/reference/follow_up.html +++ b/dev/reference/follow_up.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/follow_up2.html b/dev/reference/follow_up2.html index 37609bd..938521b 100644 --- a/dev/reference/follow_up2.html +++ b/dev/reference/follow_up2.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/index.html b/dev/reference/index.html index 378f0fd..7fc3f38 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/inspect.html b/dev/reference/inspect.html index 0021169..75c0a76 100644 --- a/dev/reference/inspect.html +++ b/dev/reference/inspect.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/optimum.html b/dev/reference/optimum.html index ea9a1f7..41ff7e2 100644 --- a/dev/reference/optimum.html +++ b/dev/reference/optimum.html @@ -14,7 +14,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/qcSubset.html b/dev/reference/qcSubset.html index 811684a..6c191ce 100644 --- a/dev/reference/qcSubset.html +++ b/dev/reference/qcSubset.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/replicates.html b/dev/reference/replicates.html index 58770a2..a555beb 100644 --- a/dev/reference/replicates.html +++ b/dev/reference/replicates.html @@ -14,7 +14,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/spatial.html b/dev/reference/spatial.html index ecb7b4a..8bf0d06 100644 --- a/dev/reference/spatial.html +++ b/dev/reference/spatial.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 @@ -124,22 +124,28 @@ Examplesindex2 <- spatial(index, survey[, c("Sex", "Smoke", "Age")], iterations = 10) head(index2) #> $A1 -#> [1] 86 131 52 76 1 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 8 207 16 107 150 #> #> $B1 -#> [1] 27 130 124 133 175 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 100 154 222 161 105 #> #> $C1 -#> [1] 74 21 110 161 99 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 88 163 209 71 1 #> #> $D1 -#> [1] 162 48 158 108 233 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 114 208 70 9 36 #> #> $E1 -#> [1] 141 234 222 166 127 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 86 112 15 171 221 #> #> $A2 -#> [1] 100 49 227 29 125 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 176 224 46 133 235 #> diff --git a/dev/reference/use_index.html b/dev/reference/use_index.html index 3614039..47fd407 100644 --- a/dev/reference/use_index.html +++ b/dev/reference/use_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/valid_followup.html b/dev/reference/valid_followup.html index 1bca148..fd9282a 100644 --- a/dev/reference/valid_followup.html +++ b/dev/reference/valid_followup.html @@ -18,7 +18,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/search.json b/dev/search.json index 3f4bf27..c1d7a66 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement package’s maintainer email. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://experdesign.llrs.dev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2018 Lluís Revilla Sancho Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"exprDesign","text":"package developed help prepare samples send facility. assumes collected samples information still need experiment several batches due technical practical limitations. question tries answer : samples go batch? possible combinations samples, looks combination minimizes differences subgroup according following rules: variable categorical tires randomize variable across subgroups. variable numeric tries distribute evenly following original distribution values. NA (available values) looks distribute randomly. Even measures might end batch effect due : - Confounding variables provided randomization batches Sometimes due unknown, impossible measure. - Lack replicates(samples conditions) can’t provide new replicates, aim provide technical replicates. Technical replicates mean reanalyzing sample twice , samples technical replicates accurate measures easier avoid detect batch effects. - Processing change methodology, pause resume later sample collection might changes outcome due external factors.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"previous-work","dir":"Articles","previous_headings":"","what":"Previous work","title":"exprDesign","text":"building package like give credit made also efforts direction: CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"DoE","dir":"Articles","previous_headings":"","what":"Design of Experiment","title":"exprDesign","text":"Imagine samples already collected want distributed batches: First can check data see concerns regarding categories: none confounding variables artificial dataset (see examples, ’ll find ). However, block incorrectly end group single batch end batch effect. order avoid design() helps assign sample batch (case batch 24 samples ). First can explore number samples number batches: Note instead using whole batch leave single sample third distributes samples three batches needed.","code":"library(\"experDesign\") metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) head(metadata, 15) ## height weight sex ## 1 60 100 Male ## 2 65 100 Male ## 3 70 100 Male ## 4 75 100 Male ## 5 80 100 Male ## 6 60 150 Male ## 7 65 150 Male ## 8 70 150 Male ## 9 75 150 Male ## 10 80 150 Male ## 11 60 200 Male ## 12 65 200 Male ## 13 70 200 Male ## 14 75 200 Male ## 15 80 200 Male check_data(metadata) ## [1] TRUE size_data <- nrow(metadata) size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) ## [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) ## [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) ## [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization","dir":"Articles","previous_headings":"","what":"Randomization","title":"exprDesign","text":"can directly look distribution samples given max number samples per batch: Naively one either fill batches fully distribute evenly (first 17 packages together, next 17 ). solution ensures data randomized. random distribution can increase number iterations performed calculate distribution.","code":"desi <- design(metadata, size_batch) # It is a list but we can convert it to a vector with: batch_names(desi) ## [1] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" ## [8] \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" ## [15] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" ## [22] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" ## [29] \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" ## [36] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" ## [43] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" ## [50] \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization-and-replicates","dir":"Articles","previous_headings":"","what":"Randomization and replicates","title":"exprDesign","text":"need space replicates control batch effect can use: seeks controls diverse values adds samples distribution. Note sample already present batch added , ’s number samples per batch different design without replicates.","code":"repli <- replicates(metadata, size_batch, 5) lengths(repli) ## SubSet1 SubSet2 SubSet3 ## 21 21 18 repli ## $SubSet1 ## [1] 3 9 10 16 17 20 27 28 30 31 32 33 34 35 40 41 42 44 45 48 49 ## ## $SubSet2 ## [1] 4 5 7 8 9 10 13 15 18 21 22 25 26 32 33 34 36 37 38 39 47 ## ## $SubSet3 ## [1] 1 2 6 9 10 11 12 14 19 23 24 29 32 33 34 43 46 50"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"layout","dir":"Articles","previous_headings":"","what":"Layout","title":"exprDesign","text":"can analyze samples distributed layout 6x4:","code":"spati <- spatial(repli, metadata, rows = LETTERS[1:6], columns = 1:4) head(spati) ## $A1 ## [1] 21 5 11 ## ## $B1 ## NULL ## ## $C1 ## [1] 58 13 33 ## ## $D1 ## [1] 35 ## ## $E1 ## [1] 3 8 15 ## ## $F1 ## [1] 9 19 53"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"report-for-easy-on-field-usage","dir":"Articles","previous_headings":"","what":"Report for easy on field usage","title":"exprDesign","text":"can add batches initial data inspect(): now can see batch position sample","code":"report <- inspect(repli, metadata) report2 <- inspect(spati, report, index_name = \"position\") head(report2) ## height weight sex batch position ## 1 60 100 Male SubSet3 A1 ## 2 65 100 Male SubSet3 A1 ## 3 70 100 Male SubSet1 A1 ## 4 75 100 Male SubSet2 C1 ## 5 80 100 Male SubSet2 C1 ## 6 60 150 Male SubSet3 C1"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"compare-indices","dir":"Articles","previous_headings":"","what":"Compare indices","title":"exprDesign","text":"two indices can also compare : many variables multiple subsets negative shows desi better.","code":"desi2 <- create_subset(nrow(metadata), size_batch) compare_index(metadata, desi, desi2) ## subgroups ## SubSet1 SubSet2 SubSet3 ## height -0.003378784 -0.4899827 -1.3652524 ## weight -5.083194894 -5.0202051 -12.6611209 ## sex 0.085527089 0.1267009 0.1152791"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"unbalanced-setting","dir":"Articles","previous_headings":"","what":"Unbalanced setting","title":"exprDesign","text":"previous case data mostly balanced (check orig object) let’s create unbalanced dataset check . dataset one female, resulting classroom full males. Age independent sex classroom. can see simple case single variable cases approximately reached entropy levels.","code":"n <- 99 samples <- 100 unbalanced <- data.frame(Classroom = rep(c(\"A\", \"B\"), each = samples/2), Sex = c(rep(\"M\", n), rep(\"F\", samples-n)), Age = rnorm(samples, mean = 25, sd = 3)) table(unbalanced[, 1:2]) ## Sex ## Classroom F M ## A 0 50 ## B 1 49 i <- design(unbalanced, 15) ## Warning: There might be some problems with the data use check_data(). evaluation <- evaluate_index(i, unbalanced) ## Warning: There might be some problems with the data use check_data(). # Mean entropy en each subset rowMeans(evaluation[\"entropy\", , ]) ## Classroom Sex Age mix_cat ## 0.98906095 0.05047991 0.00000000 0.96130358 # Original entropy on the dataset evaluate_orig(unbalanced)[\"entropy\", ] ## Warning in evaluate_orig(unbalanced): There might be some problems with the ## data use check_data(). ## Classroom Sex Age mix_cat ## 1.00000000 0.08079314 0.00000000 0.67554928 # Dispersion of the entropy apply(evaluation[\"entropy\", , ], 1, sd) ## Classroom Sex Age mix_cat ## 0.01057627 0.13355727 0.00000000 0.08171973"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"quality-check","dir":"Articles","previous_headings":"","what":"Quality check","title":"exprDesign","text":"need subset samples diverse can use following function: can also test given index check_index(): row information accurate given variable samples available (case unbalanced). variables distributed randomly others index. satisfied design() new index increasing iterations obtain potentially better distribution. want good stratified randomization increase iterations used 10 fold.","code":"data(survey, package = \"MASS\") head(survey) ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric ## 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial ## 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA ## 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric ## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric ## 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial ## Age ## 1 18.250 ## 2 17.583 ## 3 16.917 ## 4 20.333 ## 5 23.667 ## 6 21.000 samples <- extreme_cases(survey, size = 10) survey[samples, ] ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 41 Female 17.5 16.0 Right L on R NA Right Some Never 169.00 Metric ## 52 Male 20.5 20.0 Right L on R 68 Right Freq Never 190.00 Metric ## 76 Female 17.5 17.5 Right Neither 68 Right Freq Heavy 170.00 Metric ## 82 Male 19.2 18.9 Right R on L 76 Right Freq Never 176.50 Imperial ## 93 Female 18.2 17.5 Right L on R 70 Right Some Never 165.00 Metric ## 137 19.8 19.0 Left L on R 73 Neither Freq Never 172.00 Metric ## 139 Male 20.0 19.5 Right L on R NA Right Freq Never 170.00 Metric ## 142 Female 18.3 19.0 Right R on L NA Right None Never 165.00 Metric ## 154 Male 21.5 21.6 Right R on L 69 Right Freq Never 172.72 Imperial ## 221 Male 23.2 23.3 Right L on R NA Right None Heavy 171.00 Metric ## Age ## 41 17.500 ## 52 17.500 ## 76 20.667 ## 82 20.167 ## 93 19.667 ## 137 21.500 ## 139 21.417 ## 142 21.083 ## 154 70.417 ## 221 20.917 check_index(unbalanced, i) ## Warning in check_index(unbalanced, i): There might be some problems with the ## data use check_data(). ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 SubSet6 ## Classroom 0.02244529 0.03105896 0.02629978 0.02137583 0.02137583 0.02629978 ## Sex 0.16047517 0.22439953 0.16047517 0.16047517 0.16047517 0.16047517 ## Age 0.42561876 0.23886131 0.43542914 0.19353035 0.12717736 0.34552062 ## mix_cat 0.08031059 0.02527493 0.07741971 0.08111268 0.08111268 0.07741971 ## subgroups ## SubSet7 ## Classroom 0.02629978 ## Sex 0.16047517 ## Age 0.25569779 ## mix_cat 0.07741971"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"internals","dir":"Articles","previous_headings":"","what":"Internals","title":"exprDesign","text":"check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can measure index : values come calculating difference original data samples subset median, mean, mad, NA, entropy independence (chisq.test() p.value). values meaning, internally used compare possible index: compares previous index score lower previous one new index kept. done similarly spatial search, adds two new categorical variables position samples calculating statistics.","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) ## [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) ## Sex W.Hnd Smoke Age ## 1 Female Right Never 18.250 ## 2 Male Left Regul 17.583 ## 3 Male Right Occas 16.917 ## 4 Male Right Never 20.333 ## 5 Male Right Never 23.667 ## 6 Female Right Never 21.000 # Set a seed for reproducibility # Looking for groups at most of 70 samples. index <- create_subset(nrow(survey), size_subset = 70) index ## $SubSet1 ## [1] 6 13 14 15 16 17 20 26 32 34 37 47 48 51 53 56 58 59 63 ## [20] 64 67 75 77 79 80 81 85 95 102 108 111 114 115 118 119 126 130 131 ## [39] 134 136 154 156 161 180 182 183 189 192 194 202 203 209 210 211 214 224 225 ## [58] 228 229 236 ## ## $SubSet2 ## [1] 3 4 5 8 12 19 22 24 25 28 31 38 45 46 66 68 70 72 78 ## [20] 82 87 91 97 98 104 106 107 112 121 128 129 141 142 149 150 152 153 159 ## [39] 163 165 166 167 174 176 184 188 190 191 195 198 212 216 219 221 223 231 232 ## [58] 234 237 ## ## $SubSet3 ## [1] 2 7 10 23 27 30 33 39 42 49 52 60 61 62 69 71 73 74 86 ## [20] 88 89 90 94 103 109 113 116 117 123 132 133 135 140 146 151 157 158 160 ## [39] 169 171 172 173 175 181 185 187 199 205 206 207 208 213 215 217 222 226 227 ## [58] 230 235 ## ## $SubSet4 ## [1] 1 9 11 18 21 29 35 36 40 41 43 44 50 54 55 57 65 76 83 ## [20] 84 92 93 96 99 100 101 105 110 120 122 124 125 127 137 138 139 143 144 ## [39] 145 147 148 155 162 164 168 170 177 178 179 186 193 196 197 200 201 204 218 ## [58] 220 233 score_index1 <- check_index(survey[, keep], index) ## Warning in check_index(survey[, keep], index): There might be some problems ## with the data use check_data(). score_index1 ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 ## Sex 0.183272313 0.18307418 0.18473404 0.34995773 ## W.Hnd 0.201330461 0.38189871 0.16814879 0.16765764 ## Smoke 0.384839974 0.51271703 0.34958370 0.36736401 ## Age 0.247117147 0.86678868 0.69125158 0.51061368 ## mix_cat 0.006173258 0.01392375 0.01709306 0.03849348 index2 <- create_subset(nrow(survey), size_subset = 70) score_index2 <- check_index(survey[, keep], index2) ## Warning in check_index(survey[, keep], index2): There might be some problems ## with the data use check_data(). sum(rowMeans(abs(score_index2-score_index1))) ## [1] 0.9367265"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"sessioninfo","dir":"Articles","previous_headings":"","what":"SessionInfo","title":"exprDesign","text":"","code":"sessionInfo() ## R version 4.4.0 (2024-04-24) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] experDesign_0.3.0.9001 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.46 rlang_1.1.3 ## [5] xfun_0.43 purrr_1.0.2 textshaping_0.3.7 jsonlite_1.8.8 ## [9] htmltools_0.5.8.1 ragg_1.3.0 sass_0.4.9 rmarkdown_2.26 ## [13] evaluate_0.23 jquerylib_0.1.4 fastmap_1.1.1 yaml_2.3.8 ## [17] lifecycle_1.0.4 memoise_2.0.1 compiler_4.4.0 fs_1.6.4 ## [21] systemfonts_1.0.6 digest_0.6.35 R6_2.5.1 magrittr_2.0.3 ## [25] bslib_0.7.0 tools_4.4.0 pkgdown_2.0.9 cachem_1.0.8 ## [29] desc_1.4.3"},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Lluís Revilla Sancho. Author, maintainer. Juanjo Lozano. Thesis advisor. Azucena Salas Martinez. Thesis advisor.","code":""},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Revilla Sancho L (????). experDesign: Design Experiments Batches. R package version 0.3.0.9001, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. Revilla Sancho L, Lozano J, Salas Martinez (2021). “experDesign: stratifying samples batches minimal bias.” Journal Open Source Software, 6(67), 6. doi:10.21105/joss.03358, https://joss.theoj.org/papers/10.21105/joss.03358.","code":"@Manual{, title = {experDesign: Design Experiments for Batches}, author = {Lluís {Revilla Sancho}}, note = {R package version 0.3.0.9001, https://github.com/llrs/experDesign/}, url = {https://experdesign.llrs.dev}, } @Article{, title = {experDesign: stratifying samples into batches with minimal bias}, doi = {10.21105/joss.03358}, author = {Lluís {Revilla Sancho} and Juanjo Lozano and Azucena {Salas Martinez}}, journal = {Journal of Open Source Software}, year = {2021}, volume = {6}, number = {67}, pages = {6}, url = {https://joss.theoj.org/papers/10.21105/joss.03358}, }"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"experdesign","dir":"","previous_headings":"","what":"Design experiments for batches","title":"Design experiments for batches","text":"goal experDesign help manage samples experiment collected. example, checking common problems data, help reduce even prevent batch bias performing experiment, measure already done provides four main functions: check_data(): Check problems data. design(): Randomize samples according variables. replicates(): Selects samples replicates randomizes samples (highly recommended). spatial(): Randomize samples spatial grid.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Design experiments for batches","text":"install latest version CRAN use: can install development version pkgdown GitHub :","code":"install.packages(\"experDesign\") # install.packages(\"devtools\") devtools::install_github(\"llrs/experDesign\")"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Design experiments for batches","text":"can use survey dataset examples: dataset numeric, categorical values NA values.","code":"library(\"experDesign\") data(survey, package = \"MASS\") head(survey) #> Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I #> 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric #> 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial #> 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA #> 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric #> 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric #> 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial #> Age #> 1 18.250 #> 2 17.583 #> 3 16.917 #> 4 20.333 #> 5 23.667 #> 6 21.000"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"checking-initial-data","dir":"","previous_headings":"Example","what":"Checking initial data","title":"Design experiments for batches","text":"can check issues experimental point view via check_data(): can see warnings get collections problems. general, try least 3 replicates condition try data variable.","code":"check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one #> sample. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"picking-samples-for-each-batch","dir":"","previous_headings":"Example","what":"Picking samples for each batch","title":"Design experiments for batches","text":"Imagine can work groups 70, want randomize Sex, Smoke, Age, hand. 1.6543999^{61} combinations samples per batch experiment. However, combinations right handed students batch making impossible compare right handed students others draw conclusions . check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can transform vector append file pass colleague :","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) #> [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) #> Sex W.Hnd Smoke Age #> 1 Female Right Never 18.250 #> 2 Male Left Regul 17.583 #> 3 Male Right Occas 16.917 #> 4 Male Right Never 20.333 #> 5 Male Right Never 23.667 #> 6 Female Right Never 21.000 # Set a seed for reproducibility set.seed(87732135) # Looking for groups at most of 70 samples. index <- design(pheno = survey, size_subset = 70, omit = omit, iterations = 100) #> Warning: There might be some problems with the data use check_data(). index #> $SubSet1 #> [1] 3 9 10 14 16 21 23 24 25 30 44 46 56 57 59 62 63 68 69 #> [20] 70 73 80 81 85 90 94 95 97 101 103 104 105 106 111 113 119 123 125 #> [39] 139 143 151 155 164 168 174 177 178 188 190 191 200 202 210 216 224 228 229 #> [58] 232 234 237 #> #> $SubSet2 #> [1] 5 6 11 18 19 22 31 34 37 38 39 40 41 47 49 53 54 55 58 #> [20] 60 65 66 71 74 84 91 96 100 108 124 126 127 133 134 144 145 148 158 #> [39] 159 160 161 162 166 169 180 185 186 193 198 199 203 204 205 208 214 215 226 #> [58] 231 235 #> #> $SubSet3 #> [1] 1 2 13 15 26 27 36 42 48 50 51 52 61 64 67 72 76 77 78 #> [20] 86 92 98 102 107 110 115 117 118 120 121 130 136 138 140 141 142 147 156 #> [39] 167 171 173 176 184 189 194 196 197 206 209 211 212 217 218 219 221 222 227 #> [58] 230 233 #> #> $SubSet4 #> [1] 4 7 8 12 17 20 28 29 32 33 35 43 45 75 79 82 83 87 88 #> [20] 89 93 99 109 112 114 116 122 128 129 131 132 135 137 146 149 150 152 153 #> [39] 154 157 163 165 170 172 175 179 181 182 183 187 192 195 201 207 213 220 223 #> [58] 225 236 head(batch_names(index)) #> [1] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet4\" \"SubSet2\" \"SubSet2\" # Or via inspect() to keep it in a matrix format: head(inspect(index, survey[, keep])) #> Sex W.Hnd Smoke Age batch #> 1 Female Right Never 18.250 SubSet3 #> 2 Male Left Regul 17.583 SubSet3 #> 3 Male Right Occas 16.917 SubSet1 #> 4 Male Right Never 20.333 SubSet4 #> 5 Male Right Never 23.667 SubSet2 #> 6 Female Right Never 21.000 SubSet2"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"previous-work","dir":"","previous_headings":"","what":"Previous work","title":"Design experiments for batches","text":"CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"other","dir":"","previous_headings":"","what":"Other","title":"Design experiments for batches","text":"Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Name the batch — batch_names","title":"Name the batch — batch_names","text":"Given index return name batches samples ","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Name the batch — batch_names","text":"","code":"batch_names(i)"},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Name the batch — batch_names","text":"list numeric indices.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Name the batch — batch_names","text":"character vector names batch index.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Name the batch — batch_names","text":"","code":"index <- create_subset(100, 50, 2) batch <- batch_names(index) head(batch) #> [1] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check experiment data — check_data","title":"Check experiment data — check_data","text":"order run successful experiment good design needed even measuring data. functions checks several heuristics good experiment warns found.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check experiment data — check_data","text":"","code":"check_data(pheno, omit = NULL, na.omit = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check experiment data — check_data","text":"pheno Data.frame variables sample, one row one sample. omit Character vector names columns omit. na.omit Check effects missing values .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check experiment data — check_data","text":"logical value indicating everything alright (TRUE) (FALSE).","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check experiment data — check_data","text":"","code":"rdata <- expand.grid(sex = c(\"M\", \"F\"), class = c(\"lower\", \"median\", \"high\")) rdata2 <- rbind(rdata, rdata) check_data(rdata2) #> [1] TRUE # \\donttest{ #Different warnings check_data(rdata) #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE check_data(rdata[-c(1, 3), ]) #> Warning: Two categorical variables don't have all combinations. #> Warning: There is a category with just one sample. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE data(survey, package = \"MASS\") check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE # }"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Check index distribution on batches — check_index","title":"Check index distribution on batches — check_index","text":"Report statistics subset variable compared original.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check index distribution on batches — check_index","text":"","code":"check_index(pheno, index, omit = NULL)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check index distribution on batches — check_index","text":"pheno Data.frame sample information. index list indices indicating samples go subset. omit Name columns pheno omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check index distribution on batches — check_index","text":"matrix differences original data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check index distribution on batches — check_index","text":"closer values 0, less difference original distribution, better randomization.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check index distribution on batches — check_index","text":"","code":"index <- create_subset(50, 24) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) check_index(metadata, index) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.70337556 0.64335530 0.25552717 #> weight 1.78087320 23.64064592 4.85755683 #> sex 0.08412415 0.08412415 0.07659676"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Compares two indexes — compare_index","title":"Compares two indexes — compare_index","text":"Compare distribution samples two different batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compares two indexes — compare_index","text":"","code":"compare_index(pheno, index1, index2)"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compares two indexes — compare_index","text":"pheno data.frame samples characteristics normalize. index1, index2 list index sample, name column pheno batch subset character .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compares two indexes — compare_index","text":"matrix variables columns batch. Negative values indicate index1 better.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compares two indexes — compare_index","text":"","code":"index1 <- create_subset(50, 24) index2 <- batch_names(create_subset(50, 24)) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) compare_index(metadata, index1, index2) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.27800502 0.55676788 0.16930483 #> weight 1.27977491 -18.94390957 3.73226093 #> sex -0.03162073 -0.01803725 -0.02785387"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Create index of subsets of a data — create_subset","title":"Create index of subsets of a data — create_subset","text":"Index samples grouped batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create index of subsets of a data — create_subset","text":"","code":"create_subset(size_data, size_subset = NULL, n = NULL, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create index of subsets of a data — create_subset","text":"size_data numeric value amount samples distribute. size_subset numeric value amount samples per batch. n numeric value number batches. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create index of subsets of a data — create_subset","text":"random list indices samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create index of subsets of a data — create_subset","text":"","code":"index <- create_subset(100, 50, 2)"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment — design","title":"Design a batch experiment — design","text":"Given samples distribute several batches, trying equal number samples per batch. can handle numeric categorical data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment — design","text":"","code":"design(pheno, size_subset, omit = NULL, iterations = 500, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment — design","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment — design","text":"indices samples go batch.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment — design","text":"","code":"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] 16 19 23 27 28 35 37 42 54 64 74 86 90 91 92 94 96 100 106 #> [20] 116 119 120 122 124 127 128 136 137 139 154 156 159 178 181 202 204 205 207 #> [39] 208 209 212 218 219 222 223 226 229 237 #> #> $SubSet2 #> [1] 11 13 24 26 34 45 47 58 59 69 75 83 84 88 89 97 103 109 110 #> [20] 118 129 130 142 145 146 149 152 153 160 162 166 171 175 179 184 187 191 193 #> [39] 194 197 199 200 210 220 228 231 234 235 #> #> $SubSet3 #> [1] 1 9 12 14 15 17 20 21 29 30 31 38 43 44 46 48 52 53 55 #> [20] 60 67 76 79 80 82 95 98 107 112 133 138 144 147 150 151 157 169 174 #> [39] 176 188 190 198 206 216 221 227 236 #> #> $SubSet4 #> [1] 2 8 10 18 22 25 32 33 36 39 40 41 49 51 56 61 62 63 68 #> [20] 72 73 93 99 101 104 108 113 126 131 132 134 140 141 143 148 163 164 165 #> [39] 167 180 182 186 189 201 203 224 232 #> #> $SubSet5 #> [1] 3 4 5 6 7 50 57 65 66 70 71 77 78 81 85 87 102 105 111 #> [20] 114 115 117 121 123 125 135 155 158 161 168 170 172 173 177 183 185 192 195 #> [39] 196 211 213 214 215 217 225 230 233 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribution by batch — distribution","title":"Distribution by batch — distribution","text":"Checks values maximally distributed several batches. Aimed categorical variables.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribution by batch — distribution","text":"","code":"distribution(report, column)"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribution by batch — distribution","text":"report data.frame must contain batch column. can obtained inspect(). column name column one wants inspect.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribution by batch — distribution","text":"TRUE values maximal distributed, otherwise FALSE.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribution by batch — distribution","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") nas <- c(137, 70) # Omit rows with NA to avoid warnings in design index <- design(pheno = survey[-nas, columns], size_subset = 70, iterations = 10) batches <- inspect(index, survey[-nas, columns]) distribution(batches, \"Sex\") #> [1] TRUE distribution(batches, \"Smoke\") #> [1] TRUE"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the entropy — entropy","title":"Calculates the entropy — entropy","text":"Calculates entropy category. uses amount categories scale 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the entropy — entropy","text":"","code":"entropy(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the entropy — entropy","text":"x character vector two categories","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the entropy — entropy","text":"numeric value Shannon entropy scaled 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculates the entropy — entropy","text":"omits NA present.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculates the entropy — entropy","text":"","code":"entropy(c(\"H\", \"T\", \"H\", \"T\")) #> [1] 1 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", \"H\")) #> [1] 0.8631206 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", NA)) #> [1] 0.9182958 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\")) #> [1] 0.9182958 entropy(c(\"H\", \"H\", \"H\", \"H\", \"H\", \"H\", NA)) #> [1] 0"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate entropy — evaluate_entropy","title":"Evaluate entropy — evaluate_entropy","text":"Looks nominal character columns equally distributed according entropy taking account independence batches. column different row assumed sample names thus omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate entropy — evaluate_entropy","text":"","code":"evaluate_entropy(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate entropy — evaluate_entropy","text":"list numeric indices data.frame pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate entropy — evaluate_entropy","text":"Value minimize","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate entropy — evaluate_entropy","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_entropy(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.007264842 0.481002114"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare independence by chisq.test — evaluate_independence","title":"Compare independence by chisq.test — evaluate_independence","text":"Looks independence categories batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"evaluate_independence(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare independence by chisq.test — evaluate_independence","text":"Index subsets. pheno data.frame information samples.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare independence by chisq.test — evaluate_independence","text":"Returns vector p-values chisq.test category subset.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_independence(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.09211905 0.50037711"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates a data.frame — evaluate_index","title":"Evaluates a data.frame — evaluate_index","text":"Measures several indicators per group","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates a data.frame — evaluate_index","text":"","code":"evaluate_index(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates a data.frame — evaluate_index","text":"Index pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates a data.frame — evaluate_index","text":"array three dimensions mean, standard deviation (sd()), median absolute deviation (mad()) numeric variables, entropy categorical number NA subgroup.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates a data.frame — evaluate_index","text":"","code":"data(survey, package = \"MASS\") index <- create_subset(nrow(survey), 50, 5) ev_index <- evaluate_index(index, survey[, c(\"Sex\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). ev_index[\"entropy\", , ] #> subgroups #> variables SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> Sex 0.9949848 0.9544340 1.0000000 0.9970591 0.9918208 #> Smoke 0.4001934 0.4855790 0.4487245 0.6082579 0.5376809 #> mix_cat 0.6660806 0.6605638 0.6587911 0.7305701 0.7266037"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate median absolute deviation — evaluate_mad","title":"Evaluate median absolute deviation — evaluate_mad","text":"Looks median absolute deviation values subgroup.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"evaluate_mad(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate median absolute deviation — evaluate_mad","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate median absolute deviation — evaluate_mad","text":"vector mean difference median absolute deviation group original mad.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mad(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 25.90814"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_mean","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"Looks mean numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"evaluate_mean(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"matrix mean value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mean(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 0.2733898"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate the dispersion of NAs — evaluate_na","title":"Evaluate the dispersion of NAs — evaluate_na","text":"Looks NA distributed subset","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"evaluate_na(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate the dispersion of NAs — evaluate_na","text":"list numeric indices data.frame pheno Data.frame","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate the dispersion of NAs — evaluate_na","text":"optimum value reduce","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"samples <- 10 m <- matrix(rnorm(samples), nrow = samples) m[sample(seq_len(samples), size = 5), ] <- NA # Some NA i <- create_subset(samples, 3, 4) # random subsets evaluate_na(i, m) #> [1] 0.375"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate each variable provided — evaluate_orig","title":"Evaluate each variable provided — evaluate_orig","text":"Measure summary statistics whole cohort samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"evaluate_orig(pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate each variable provided — evaluate_orig","text":"pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate each variable provided — evaluate_orig","text":"matrix mean, standard deviation, MAD values numeric variables, entropy categorical, amount NA per variable.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"data(survey, package = \"MASS\") evaluate_orig(survey[, c(\"Sex\", \"Age\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). #> Sex Age Smoke mix_cat #> mean 0 20.374515 0.0000000 0.0000000 #> sd 0 6.474335 0.0000000 0.0000000 #> mad 0 1.605656 0.0000000 0.0000000 #> na 1 0.000000 1.0000000 0.0000000 #> entropy 1 0.000000 0.5143828 0.6268135 #> independence 0 0.000000 0.0000000 0.0000000"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_sd","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"Looks standard deviation numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"evaluate_sd(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"List indices pheno Data.frame samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"matrix standard deviation value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_sd(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 1.647705"},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":null,"dir":"Reference","previous_headings":"","what":"experDesign: Expert experiment design in batches — experDesign-package","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Enables easy distribution samples per batch avoiding batch confounding effects randomization variables batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"important function design(), distributes samples batches according information provided. help bench inspect() function appends group data provided. grid spatial data, might want look spatial() function distribute samples keeping original design. case experiment half processed need extend can use follow_up() follow_up2(). helps selecting samples already used used follow .","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Lluís Revilla","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Select the subset of extreme cases to evaluation — extreme_cases","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"Subset samples mostly different.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"extreme_cases(pheno, size, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"pheno Data.frame sample information. size number samples subset. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"vector number rows selected.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) sel <- extreme_cases(metadata, 10) # We can see that it selected both Female and Males and wide range of height # and weight: metadata[sel, ] #> height weight sex #> 1 60 100 Male #> 4 75 100 Male #> 5 80 100 Male #> 13 70 200 Male #> 14 75 200 Male #> 21 60 300 Male #> 25 80 300 Male #> 29 75 100 Female #> 47 65 300 Female #> 48 70 300 Female"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments — follow_up","title":"Follow up experiments — follow_up","text":"experiment carried samples want continue samples later .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments — follow_up","text":"","code":"follow_up( original, follow_up, size_subset, omit = NULL, old_new = \"batch\", iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments — follow_up","text":"original data.frame information samples used originally. follow_up data.frame information new samples. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. old_new Name column batch status stored. matches name column original used find previous batches. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments — follow_up","text":"data.frame common columns data, new column old_new, batch column filled new batches needed.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments — follow_up","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] fu <- follow_up(survey1, survey2, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> Warning: Column batch is already present. Did you meant this?"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments in batches — follow_up2","title":"Follow up experiments in batches — follow_up2","text":"Design experiment data new old together.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments in batches — follow_up2","text":"","code":"follow_up2(all_data, batch_column = \"batch\", ...)"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments in batches — follow_up2","text":"all_data data.frame data samples. row sample. batch_column name column all_data batches used. NA interpreted new data, empty considered batch. ... Arguments passed design size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments in batches — follow_up2","text":"data.frame batch_column filled new batches needed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Follow up experiments in batches — follow_up2","text":"batch_column empty samples considered new. size_subset missing, estimated previous batch Similarly, iterations name guessed inferred samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments in batches — follow_up2","text":"","code":"data(survey, package = \"MASS\") # Create the first batch first_batch_n <- 118 variables <- c(\"Sex\", \"Smoke\", \"Age\") survey1 <- survey[seq_len(first_batch_n), variables] index1 <- design(survey1, size_subset = 50, iterations = 10) #> Warning: There might be some problems with the data use check_data(). r_survey <- inspect(index1, survey1) # Create the second batch with \"new\" students survey2 <- survey[seq(from = first_batch_n +1, to = nrow(survey)), variables] survey2$batch <- NA # Prepare the follow up all_classroom <- rbind(r_survey, survey2) follow_up2(all_classroom, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet1\" #> [6] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [11] \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet1\" #> [16] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [21] \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [26] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [31] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [36] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet3\" #> [41] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [46] \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [51] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet2\" #> [56] \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [61] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [66] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" #> [71] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [76] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet2\" #> [81] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [86] \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [91] \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet2\" #> [96] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [101] \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" #> [106] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [111] \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [116] \"SubSet3\" \"SubSet1\" \"SubSet3\" \"NewSubset1\" \"NewSubset3\" #> [121] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" #> [126] \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [131] \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [136] \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" #> [141] \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [146] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset2\" #> [151] \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" #> [156] \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [161] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [166] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" #> [171] \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset2\" #> [176] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [181] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [186] \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [191] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" #> [196] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" #> [201] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [206] \"NewSubset3\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [211] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" #> [216] \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" #> [221] \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [226] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [231] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [236] \"NewSubset2\" \"NewSubset1\""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":null,"dir":"Reference","previous_headings":"","what":"Inspect the index — inspect","title":"Inspect the index — inspect","text":"Given index data samples append batch assignment","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inspect the index — inspect","text":"","code":"inspect(i, pheno, omit = NULL, index_name = \"batch\")"},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inspect the index — inspect","text":"List indices samples per batch pheno Data.frame sample information. omit Name columns pheno omitted. index_name Column name index resulting data.frame.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inspect the index — inspect","text":"data.frame new column batch name batch sample goes .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inspect the index — inspect","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") index <- design(pheno = survey[, columns], size_subset = 70, iterations = 10) #> Warning: There might be some problems with the data use check_data(). batches <- inspect(index, survey[, columns]) head(batches) #> Sex Age Smoke batch #> 1 Female 18.250 Never SubSet3 #> 2 Male 17.583 Regul SubSet4 #> 3 Male 16.917 Occas SubSet3 #> 4 Male 20.333 Never SubSet4 #> 5 Male 23.667 Never SubSet3 #> 6 Female 21.000 Never SubSet4"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":null,"dir":"Reference","previous_headings":"","what":"Optimum values for batches — optimum","title":"Optimum values for batches — optimum","text":"Calculates optimum values number batches size batches. need several batches can better distribute evenly add replicates.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optimum values for batches — optimum","text":"","code":"optimum_batches(size_data, size_subset) optimum_subset(size_data, batches) sizes_batches(size_data, size_subset, batches)"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optimum values for batches — optimum","text":"size_data numeric value number samples use. size_subset Numeric value number sample per batch. batches numeric value number batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optimum values for batches — optimum","text":"optimum_batches numeric value number batches use. optimum_subset numeric value maximum number samples per batch data. sizes_batches numeric vector number samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Optimum values for batches — optimum","text":"","code":"size_data <- 50 size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) #> [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) #> [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) #> [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":null,"dir":"Reference","previous_headings":"","what":"Random subset — qcSubset","title":"Random subset — qcSubset","text":"Select randomly samples index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random subset — qcSubset","text":"","code":"qcSubset(index, size, each = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random subset — qcSubset","text":"index list indices indicating samples go subset. size number samples taken. logical value subset taken samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random subset — qcSubset","text":"","code":"set.seed(50) index <- create_subset(100, 50, 2) QC_samples <- qcSubset(index, 10) QC_samplesBatch <- qcSubset(index, 10, TRUE)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment with experimental controls — replicates","title":"Design a batch experiment with experimental controls — replicates","text":"ensure batches comparable samples processed batch. function allows take account effect. uses different samples controls defined extreme_cases().","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"replicates(pheno, size_subset, controls, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment with experimental controls — replicates","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. controls numeric value amount technical controls per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment with experimental controls — replicates","text":"index samples duplicated batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Design a batch experiment with experimental controls — replicates","text":"control variance replicates important, see example https://www.nature.com/articles/nmeth.3091.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"samples <- data.frame(L = letters[1:25], Age = rnorm(25), type = sample(LETTERS[1:5], 25, TRUE)) index <- replicates(samples, 5, controls = 2, omit = \"L\", iterations = 10) head(index) #> $SubSet1 #> [1] 1 7 12 19 21 #> #> $SubSet2 #> [1] 2 4 17 19 21 #> #> $SubSet3 #> [1] 6 18 19 21 25 #> #> $SubSet4 #> [1] 5 19 21 22 23 #> #> $SubSet5 #> [1] 3 8 11 19 21 #> #> $SubSet6 #> [1] 10 19 21 24 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribute the sample on the plate — spatial","title":"Distribute the sample on the plate — spatial","text":"function assumes process batch samples distributed plate grid scheme.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribute the sample on the plate — spatial","text":"","code":"spatial( index, pheno, omit = NULL, remove_positions = NULL, rows = LETTERS[1:5], columns = 1:10, iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribute the sample on the plate — spatial","text":"index list samples subgroup, provided design() replicates(). pheno Data.frame sample information. omit Name columns pheno omitted. remove_positions Character, name positions avoided grid. rows Character, name rows used. columns Character, name rows used. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribute the sample on the plate — spatial","text":"indices samples go batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribute the sample on the plate — spatial","text":"","code":"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(). index2 <- spatial(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")], iterations = 10) head(index2) #> $A1 #> [1] 86 131 52 76 1 #> #> $B1 #> [1] 27 130 124 133 175 #> #> $C1 #> [1] 74 21 110 161 99 #> #> $D1 #> [1] 162 48 158 108 233 #> #> $E1 #> [1] 141 234 222 166 127 #> #> $A2 #> [1] 100 49 227 29 125 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a factor to index — use_index","title":"Convert a factor to index — use_index","text":"Convert given factor accepted index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a factor to index — use_index","text":"","code":"use_index(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a factor to index — use_index","text":"x character factor used index","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert a factor to index — use_index","text":"","code":"plates <- c(\"P1\", \"P2\", \"P1\", \"P2\", \"P2\", \"P3\", \"P1\", \"P3\", \"P1\", \"P1\") use_index(plates) #> $P1 #> [1] 1 3 7 9 10 #> #> $P2 #> [1] 2 4 5 #> #> $P3 #> [1] 6 8 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":null,"dir":"Reference","previous_headings":"","what":"Check the data for a follow up experiment. — valid_followup","title":"Check the data for a follow up experiment. — valid_followup","text":"Sometimes samples collected analyzed, later another batch samples analyzed. function tries detect problems data data combined single analysis. know specific problems data need use check_data()","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"valid_followup( old_data = NULL, new_data = NULL, all_data = NULL, omit = NULL, column = \"batch\" )"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check the data for a follow up experiment. — valid_followup","text":"old_data, new_data data.frame old new data respectively. all_data data.frame data samples. row sample. omit Name columns pheno omitted. column name column old data batch information, whether data new (NA) case all_data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check the data for a follow up experiment. — valid_followup","text":"Called side effects warnings, returns logical value issues (FALSE) (TRUE)","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] valid_followup(survey1, survey2) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE survey$batch <- NA survey$batch[1:118] <- \"old\" valid_followup(all_data = survey) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-development-version","dir":"Changelog","previous_headings":"","what":"experDesign (development version)","title":"experDesign (development version)","text":"Check index used inspect valid length, positions replications matching data provided. check_data() gains new omit argument (#49). relied positional arguments break scripts. Omitting non existing columns now creates warning.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-030","dir":"Changelog","previous_headings":"","what":"experDesign 0.3.0","title":"experDesign 0.3.0","text":"CRAN release: 2024-02-20 Fixed bug spatial() multiple samples assigned position plate (#45). Added warning batch_names() index repeated positions (revealed #45).","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-020","dir":"Changelog","previous_headings":"","what":"experDesign 0.2.0","title":"experDesign 0.2.0","text":"CRAN release: 2023-04-05 New follow_up() follow_up2() continue experiment safely (#22). New check_data() check input data (#37). New compare_index() compare different indexes per batch. Use categories combined (column mix_cat) comparing batches. Increased internal coherence checks. Added thesis advisers description. Update documentation.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-010","dir":"Changelog","previous_headings":"","what":"experDesign 0.1.0","title":"experDesign 0.1.0","text":"CRAN release: 2021-04-22 Added reference new package Omixer README. Fixed batches sizes errors. Speed increase (5x) design, spatial replicates. Update Code Conduct. Add online documentation url.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-004","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.4","title":"experDesign 0.0.4","text":"CRAN release: 2020-09-28 Remove BiocStyle dependency. Gain ability name subsets. Add examples functions. Add function consider spatial distribution plates/machines.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-002","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.2","title":"experDesign 0.0.2","text":"CRAN release: 2020-09-08 CRAN release","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-0009000","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.0.9000","title":"experDesign 0.0.0.9000","text":"Added NEWS.md file track changes package.","code":""}] +[{"path":[]},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement package’s maintainer email. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://experdesign.llrs.dev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2018 Lluís Revilla Sancho Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"exprDesign","text":"package developed help prepare samples send facility. assumes collected samples information still need experiment several batches due technical practical limitations. question tries answer : samples go batch? possible combinations samples, looks combination minimizes differences subgroup according following rules: variable categorical tires randomize variable across subgroups. variable numeric tries distribute evenly following original distribution values. NA (available values) looks distribute randomly. Even measures might end batch effect due : - Confounding variables provided randomization batches Sometimes due unknown, impossible measure. - Lack replicates(samples conditions) can’t provide new replicates, aim provide technical replicates. Technical replicates mean reanalyzing sample twice , samples technical replicates accurate measures easier avoid detect batch effects. - Processing change methodology, pause resume later sample collection might changes outcome due external factors.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"previous-work","dir":"Articles","previous_headings":"","what":"Previous work","title":"exprDesign","text":"building package like give credit made also efforts direction: CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"DoE","dir":"Articles","previous_headings":"","what":"Design of Experiment","title":"exprDesign","text":"Imagine samples already collected want distributed batches: First can check data see concerns regarding categories: none confounding variables artificial dataset (see examples, ’ll find ). However, block incorrectly end group single batch end batch effect. order avoid design() helps assign sample batch (case batch 24 samples ). First can explore number samples number batches: Note instead using whole batch leave single sample third distributes samples three batches needed.","code":"library(\"experDesign\") metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) head(metadata, 15) ## height weight sex ## 1 60 100 Male ## 2 65 100 Male ## 3 70 100 Male ## 4 75 100 Male ## 5 80 100 Male ## 6 60 150 Male ## 7 65 150 Male ## 8 70 150 Male ## 9 75 150 Male ## 10 80 150 Male ## 11 60 200 Male ## 12 65 200 Male ## 13 70 200 Male ## 14 75 200 Male ## 15 80 200 Male check_data(metadata) ## [1] TRUE size_data <- nrow(metadata) size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) ## [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) ## [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) ## [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization","dir":"Articles","previous_headings":"","what":"Randomization","title":"exprDesign","text":"can directly look distribution samples given max number samples per batch: Naively one either fill batches fully distribute evenly (first 17 packages together, next 17 ). solution ensures data randomized. random distribution can increase number iterations performed calculate distribution.","code":"desi <- design(metadata, size_batch) # It is a list but we can convert it to a vector with: batch_names(desi) ## [1] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" ## [8] \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" ## [15] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" ## [22] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" ## [29] \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" ## [36] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" ## [43] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" ## [50] \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization-and-replicates","dir":"Articles","previous_headings":"","what":"Randomization and replicates","title":"exprDesign","text":"need space replicates control batch effect can use: seeks controls diverse values adds samples distribution. Note sample already present batch added , ’s number samples per batch different design without replicates.","code":"repli <- replicates(metadata, size_batch, 5) lengths(repli) ## SubSet1 SubSet2 SubSet3 ## 21 21 18 repli ## $SubSet1 ## [1] 3 9 10 16 17 20 27 28 30 31 32 33 34 35 40 41 42 44 45 48 49 ## ## $SubSet2 ## [1] 4 5 7 8 9 10 13 15 18 21 22 25 26 32 33 34 36 37 38 39 47 ## ## $SubSet3 ## [1] 1 2 6 9 10 11 12 14 19 23 24 29 32 33 34 43 46 50"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"layout","dir":"Articles","previous_headings":"","what":"Layout","title":"exprDesign","text":"can analyze samples distributed layout 6x4:","code":"spati <- spatial(repli, metadata, rows = LETTERS[1:6], columns = 1:4) head(spati) ## $A1 ## SubSet1 SubSet2 SubSet3 ## 32 43 56 ## ## $B1 ## SubSet1 SubSet2 SubSet3 ## 3 37 27 ## ## $C1 ## SubSet1 SubSet2 SubSet3 ## 34 29 28 ## ## $D1 ## SubSet1 SubSet2 SubSet3 ## 36 5 60 ## ## $E1 ## SubSet1 SubSet2 SubSet3 ## 52 13 33 ## ## $F1 ## SubSet1 SubSet2 SubSet3 ## 39 7 53"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"report-for-easy-on-field-usage","dir":"Articles","previous_headings":"","what":"Report for easy on field usage","title":"exprDesign","text":"can add batches initial data inspect(): now can see batch position sample","code":"report <- inspect(repli, metadata) report2 <- inspect(spati, report, index_name = \"position\") head(report2) ## height weight sex batch position ## 1 60 100 Male SubSet3 E2 ## 2 65 100 Male SubSet3 D2 ## 3 70 100 Male SubSet1 B1 ## 4 75 100 Male SubSet2 E3 ## 5 80 100 Male SubSet2 D1 ## 6 60 150 Male SubSet3 B2"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"compare-indices","dir":"Articles","previous_headings":"","what":"Compare indices","title":"exprDesign","text":"two indices can also compare : many variables multiple subsets negative shows desi better.","code":"desi2 <- create_subset(nrow(metadata), size_batch) compare_index(metadata, desi, desi2) ## subgroups ## SubSet1 SubSet2 SubSet3 ## height 0.21717472 0.30918015 -0.008630805 ## weight -3.20170175 -3.83581391 -11.626327348 ## sex -0.00669491 0.00669491 -0.011421802"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"unbalanced-setting","dir":"Articles","previous_headings":"","what":"Unbalanced setting","title":"exprDesign","text":"previous case data mostly balanced (check orig object) let’s create unbalanced dataset check . dataset one female, resulting classroom full males. Age independent sex classroom. can see simple case single variable cases approximately reached entropy levels.","code":"n <- 99 samples <- 100 unbalanced <- data.frame(Classroom = rep(c(\"A\", \"B\"), each = samples/2), Sex = c(rep(\"M\", n), rep(\"F\", samples-n)), Age = rnorm(samples, mean = 25, sd = 3)) table(unbalanced[, 1:2]) ## Sex ## Classroom F M ## A 0 50 ## B 1 49 i <- design(unbalanced, 15) ## Warning: There might be some problems with the data use check_data(). evaluation <- evaluate_index(i, unbalanced) ## Warning: There might be some problems with the data use check_data(). # Mean entropy en each subset rowMeans(evaluation[\"entropy\", , ]) ## Classroom Sex Age mix_cat ## 0.96035770 0.05303319 0.00000000 0.93994182 # Original entropy on the dataset evaluate_orig(unbalanced)[\"entropy\", ] ## Warning in evaluate_orig(unbalanced): There might be some problems with the ## data use check_data(). ## Classroom Sex Age mix_cat ## 1.00000000 0.08079314 0.00000000 0.67554928 # Dispersion of the entropy apply(evaluation[\"entropy\", , ], 1, sd) ## Classroom Sex Age mix_cat ## 0.05017590 0.14031263 0.00000000 0.07994645"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"quality-check","dir":"Articles","previous_headings":"","what":"Quality check","title":"exprDesign","text":"need subset samples diverse can use following function: can also test given index check_index(): row information accurate given variable samples available (case unbalanced). variables distributed randomly others index. satisfied design() new index increasing iterations obtain potentially better distribution. want good stratified randomization increase iterations used 10 fold.","code":"data(survey, package = \"MASS\") head(survey) ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric ## 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial ## 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA ## 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric ## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric ## 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial ## Age ## 1 18.250 ## 2 17.583 ## 3 16.917 ## 4 20.333 ## 5 23.667 ## 6 21.000 samples <- extreme_cases(survey, size = 10) survey[samples, ] ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric ## 9 Male 20.0 19.5 Right R on L 72 Right Some Never 175.00 Metric ## 84 Female 17.0 17.4 Right R on L NA Neither Some Never NA ## 99 Male 19.5 19.4 Right Neither NA Right Freq Never 165.00 Metric ## 107 Female 16.2 16.4 Right R on L NA Right Freq Occas 172.00 Metric ## 171 Female 16.5 17.0 Right L on R NA Right Some Never 168.00 Metric ## 177 Male 20.5 20.5 Right Neither 76 Right Freq Regul 172.72 Imperial ## 191 Male 20.0 19.5 Right R on L 92 Right Some Never 179.10 Imperial ## 201 Female 16.2 15.8 Right R on L 61 Right Some Occas 167.00 Metric ## 202 Male 21.0 21.0 Right L on R 48 Neither Freq Never 174.00 Metric ## Age ## 5 23.667 ## 9 19.000 ## 84 17.167 ## 99 18.083 ## 107 17.000 ## 171 73.000 ## 177 36.583 ## 191 18.917 ## 201 19.250 ## 202 21.333 check_index(unbalanced, i) ## Warning in check_index(unbalanced, i): There might be some problems with the ## data use check_data(). ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 SubSet6 ## Classroom 0.02116629 0.02116629 0.04000152 0.04000152 0.06572331 0.02009684 ## Sex 0.17853702 0.17853702 0.24841904 0.17853702 0.17853702 0.17853702 ## Age 0.20351157 0.19733814 0.25375813 0.28706685 0.12655149 0.14621487 ## mix_cat 0.08031059 0.08031059 0.03045638 0.06618417 0.04689282 0.08111268 ## subgroups ## SubSet7 ## Classroom 0.02502079 ## Sex 0.17853702 ## Age 0.45676502 ## mix_cat 0.07741971"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"internals","dir":"Articles","previous_headings":"","what":"Internals","title":"exprDesign","text":"check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can measure index : values come calculating difference original data samples subset median, mean, mad, NA, entropy independence (chisq.test() p.value). values meaning, internally used compare possible index: compares previous index score lower previous one new index kept. done similarly spatial search, adds two new categorical variables position samples calculating statistics.","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) ## [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) ## Sex W.Hnd Smoke Age ## 1 Female Right Never 18.250 ## 2 Male Left Regul 17.583 ## 3 Male Right Occas 16.917 ## 4 Male Right Never 20.333 ## 5 Male Right Never 23.667 ## 6 Female Right Never 21.000 # Set a seed for reproducibility # Looking for groups at most of 70 samples. index <- create_subset(nrow(survey), size_subset = 70) index ## $SubSet1 ## [1] 9 12 21 25 34 37 43 47 58 59 65 67 68 73 74 77 79 80 103 ## [20] 104 113 120 136 140 142 143 144 148 152 153 162 164 165 170 172 173 174 176 ## [39] 178 181 182 185 189 190 192 194 197 202 203 205 208 214 215 217 219 221 224 ## [58] 231 235 237 ## ## $SubSet2 ## [1] 1 2 7 8 22 23 29 30 33 36 39 42 45 46 51 54 55 64 71 ## [20] 75 76 91 102 105 109 111 114 115 117 118 119 123 125 128 132 135 138 154 ## [39] 155 159 167 177 187 191 193 195 196 198 200 201 207 211 212 218 222 227 228 ## [58] 230 233 ## ## $SubSet3 ## [1] 3 4 11 13 14 15 18 19 20 24 28 31 32 35 41 48 49 50 52 ## [20] 70 72 81 84 85 86 87 92 93 94 98 112 121 122 124 126 127 129 130 ## [39] 134 137 139 141 147 151 157 158 161 168 171 179 183 199 204 210 213 220 223 ## [58] 225 234 ## ## $SubSet4 ## [1] 5 6 10 16 17 26 27 38 40 44 53 56 57 60 61 62 63 66 69 ## [20] 78 82 83 88 89 90 95 96 97 99 100 101 106 107 108 110 116 131 133 ## [39] 145 146 149 150 156 160 163 166 169 175 180 184 186 188 206 209 216 226 229 ## [58] 232 236 score_index1 <- check_index(survey[, keep], index) ## Warning in check_index(survey[, keep], index): There might be some problems ## with the data use check_data(). score_index1 ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 ## Sex 0.285472670 0.28479310 0.45087536 0.28479310 ## W.Hnd 0.406863574 0.56967175 0.38262251 0.38311366 ## Smoke 0.352226528 0.35423141 0.51717322 0.36004142 ## Age 0.966161840 0.88451852 0.78376910 1.52773530 ## mix_cat 0.009637159 0.02713277 0.02836273 0.00787233 index2 <- create_subset(nrow(survey), size_subset = 70) score_index2 <- check_index(survey[, keep], index2) ## Warning in check_index(survey[, keep], index2): There might be some problems ## with the data use check_data(). sum(rowMeans(abs(score_index2-score_index1))) ## [1] 0.8869192"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"sessioninfo","dir":"Articles","previous_headings":"","what":"SessionInfo","title":"exprDesign","text":"","code":"sessionInfo() ## R version 4.4.0 (2024-04-24) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] experDesign_0.3.0.9002 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.46 rlang_1.1.3 ## [5] xfun_0.43 purrr_1.0.2 textshaping_0.3.7 jsonlite_1.8.8 ## [9] htmltools_0.5.8.1 ragg_1.3.1 sass_0.4.9 rmarkdown_2.26 ## [13] evaluate_0.23 jquerylib_0.1.4 fastmap_1.1.1 yaml_2.3.8 ## [17] lifecycle_1.0.4 memoise_2.0.1 compiler_4.4.0 fs_1.6.4 ## [21] systemfonts_1.0.6 digest_0.6.35 R6_2.5.1 magrittr_2.0.3 ## [25] bslib_0.7.0 tools_4.4.0 pkgdown_2.0.9 cachem_1.0.8 ## [29] desc_1.4.3"},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Lluís Revilla Sancho. Author, maintainer. Juanjo Lozano. Thesis advisor. Azucena Salas Martinez. Thesis advisor.","code":""},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Revilla Sancho L (????). experDesign: Design Experiments Batches. R package version 0.3.0.9002, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. Revilla Sancho L, Lozano J, Salas Martinez (2021). “experDesign: stratifying samples batches minimal bias.” Journal Open Source Software, 6(67), 6. doi:10.21105/joss.03358, https://joss.theoj.org/papers/10.21105/joss.03358.","code":"@Manual{, title = {experDesign: Design Experiments for Batches}, author = {Lluís {Revilla Sancho}}, note = {R package version 0.3.0.9002, https://github.com/llrs/experDesign/}, url = {https://experdesign.llrs.dev}, } @Article{, title = {experDesign: stratifying samples into batches with minimal bias}, doi = {10.21105/joss.03358}, author = {Lluís {Revilla Sancho} and Juanjo Lozano and Azucena {Salas Martinez}}, journal = {Journal of Open Source Software}, year = {2021}, volume = {6}, number = {67}, pages = {6}, url = {https://joss.theoj.org/papers/10.21105/joss.03358}, }"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"experdesign","dir":"","previous_headings":"","what":"Design experiments for batches","title":"Design experiments for batches","text":"goal experDesign help manage samples experiment collected. example, checking common problems data, help reduce even prevent batch bias performing experiment, measure already done provides four main functions: check_data(): Check problems data. design(): Randomize samples according variables. replicates(): Selects samples replicates randomizes samples (highly recommended). spatial(): Randomize samples spatial grid.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Design experiments for batches","text":"install latest version CRAN use: can install development version pkgdown GitHub :","code":"install.packages(\"experDesign\") # install.packages(\"devtools\") devtools::install_github(\"llrs/experDesign\")"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Design experiments for batches","text":"can use survey dataset examples: dataset numeric, categorical values NA values.","code":"library(\"experDesign\") data(survey, package = \"MASS\") head(survey) #> Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I #> 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric #> 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial #> 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA #> 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric #> 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric #> 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial #> Age #> 1 18.250 #> 2 17.583 #> 3 16.917 #> 4 20.333 #> 5 23.667 #> 6 21.000"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"checking-initial-data","dir":"","previous_headings":"Example","what":"Checking initial data","title":"Design experiments for batches","text":"can check issues experimental point view via check_data(): can see warnings get collections problems. general, try least 3 replicates condition try data variable.","code":"check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one #> sample. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"picking-samples-for-each-batch","dir":"","previous_headings":"Example","what":"Picking samples for each batch","title":"Design experiments for batches","text":"Imagine can work groups 70, want randomize Sex, Smoke, Age, hand. 1.6543999^{61} combinations samples per batch experiment. However, combinations right handed students batch making impossible compare right handed students others draw conclusions . check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can transform vector append file pass colleague :","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) #> [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) #> Sex W.Hnd Smoke Age #> 1 Female Right Never 18.250 #> 2 Male Left Regul 17.583 #> 3 Male Right Occas 16.917 #> 4 Male Right Never 20.333 #> 5 Male Right Never 23.667 #> 6 Female Right Never 21.000 # Set a seed for reproducibility set.seed(87732135) # Looking for groups at most of 70 samples. index <- design(pheno = survey, size_subset = 70, omit = omit, iterations = 100) #> Warning: There might be some problems with the data use check_data(). index #> $SubSet1 #> [1] 3 9 10 14 16 21 23 24 25 30 44 46 56 57 59 62 63 68 69 #> [20] 70 73 80 81 85 90 94 95 97 101 103 104 105 106 111 113 119 123 125 #> [39] 139 143 151 155 164 168 174 177 178 188 190 191 200 202 210 216 224 228 229 #> [58] 232 234 237 #> #> $SubSet2 #> [1] 5 6 11 18 19 22 31 34 37 38 39 40 41 47 49 53 54 55 58 #> [20] 60 65 66 71 74 84 91 96 100 108 124 126 127 133 134 144 145 148 158 #> [39] 159 160 161 162 166 169 180 185 186 193 198 199 203 204 205 208 214 215 226 #> [58] 231 235 #> #> $SubSet3 #> [1] 1 2 13 15 26 27 36 42 48 50 51 52 61 64 67 72 76 77 78 #> [20] 86 92 98 102 107 110 115 117 118 120 121 130 136 138 140 141 142 147 156 #> [39] 167 171 173 176 184 189 194 196 197 206 209 211 212 217 218 219 221 222 227 #> [58] 230 233 #> #> $SubSet4 #> [1] 4 7 8 12 17 20 28 29 32 33 35 43 45 75 79 82 83 87 88 #> [20] 89 93 99 109 112 114 116 122 128 129 131 132 135 137 146 149 150 152 153 #> [39] 154 157 163 165 170 172 175 179 181 182 183 187 192 195 201 207 213 220 223 #> [58] 225 236 head(batch_names(index)) #> [1] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet4\" \"SubSet2\" \"SubSet2\" # Or via inspect() to keep it in a matrix format: head(inspect(index, survey[, keep])) #> Sex W.Hnd Smoke Age batch #> 1 Female Right Never 18.250 SubSet3 #> 2 Male Left Regul 17.583 SubSet3 #> 3 Male Right Occas 16.917 SubSet1 #> 4 Male Right Never 20.333 SubSet4 #> 5 Male Right Never 23.667 SubSet2 #> 6 Female Right Never 21.000 SubSet2"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"previous-work","dir":"","previous_headings":"","what":"Previous work","title":"Design experiments for batches","text":"CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"other","dir":"","previous_headings":"","what":"Other","title":"Design experiments for batches","text":"Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Name the batch — batch_names","title":"Name the batch — batch_names","text":"Given index return name batches samples ","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Name the batch — batch_names","text":"","code":"batch_names(i)"},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Name the batch — batch_names","text":"list numeric indices.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Name the batch — batch_names","text":"character vector names batch index.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Name the batch — batch_names","text":"","code":"index <- create_subset(100, 50, 2) batch <- batch_names(index) head(batch) #> [1] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check experiment data — check_data","title":"Check experiment data — check_data","text":"order run successful experiment good design needed even measuring data. functions checks several heuristics good experiment warns found.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check experiment data — check_data","text":"","code":"check_data(pheno, omit = NULL, na.omit = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check experiment data — check_data","text":"pheno Data.frame variables sample, one row one sample. omit Character vector names columns omit. na.omit Check effects missing values .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check experiment data — check_data","text":"logical value indicating everything alright (TRUE) (FALSE).","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check experiment data — check_data","text":"","code":"rdata <- expand.grid(sex = c(\"M\", \"F\"), class = c(\"lower\", \"median\", \"high\")) rdata2 <- rbind(rdata, rdata) check_data(rdata2) #> [1] TRUE # \\donttest{ #Different warnings check_data(rdata) #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE check_data(rdata[-c(1, 3), ]) #> Warning: Two categorical variables don't have all combinations. #> Warning: There is a category with just one sample. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE data(survey, package = \"MASS\") check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE # }"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Check index distribution on batches — check_index","title":"Check index distribution on batches — check_index","text":"Report statistics subset variable compared original.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check index distribution on batches — check_index","text":"","code":"check_index(pheno, index, omit = NULL)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check index distribution on batches — check_index","text":"pheno Data.frame sample information. index list indices indicating samples go subset. omit Name columns pheno omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check index distribution on batches — check_index","text":"matrix differences original data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check index distribution on batches — check_index","text":"closer values 0, less difference original distribution, better randomization.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check index distribution on batches — check_index","text":"","code":"index <- create_subset(50, 24) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) check_index(metadata, index) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.70337556 0.64335530 0.25552717 #> weight 1.78087320 23.64064592 4.85755683 #> sex 0.08412415 0.08412415 0.07659676"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Compares two indexes — compare_index","title":"Compares two indexes — compare_index","text":"Compare distribution samples two different batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compares two indexes — compare_index","text":"","code":"compare_index(pheno, index1, index2)"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compares two indexes — compare_index","text":"pheno data.frame samples characteristics normalize. index1, index2 list index sample, name column pheno batch subset character .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compares two indexes — compare_index","text":"matrix variables columns batch. Negative values indicate index1 better.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compares two indexes — compare_index","text":"","code":"index1 <- create_subset(50, 24) index2 <- batch_names(create_subset(50, 24)) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) compare_index(metadata, index1, index2) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.27800502 0.55676788 0.16930483 #> weight 1.27977491 -18.94390957 3.73226093 #> sex -0.03162073 -0.01803725 -0.02785387"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Create index of subsets of a data — create_subset","title":"Create index of subsets of a data — create_subset","text":"Index samples grouped batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create index of subsets of a data — create_subset","text":"","code":"create_subset(size_data, size_subset = NULL, n = NULL, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create index of subsets of a data — create_subset","text":"size_data numeric value amount samples distribute. size_subset numeric value amount samples per batch. n numeric value number batches. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create index of subsets of a data — create_subset","text":"random list indices samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create index of subsets of a data — create_subset","text":"","code":"index <- create_subset(100, 50, 2)"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment — design","title":"Design a batch experiment — design","text":"Given samples distribute several batches, trying equal number samples per batch. can handle numeric categorical data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment — design","text":"","code":"design(pheno, size_subset, omit = NULL, iterations = 500, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment — design","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment — design","text":"indices samples go batch.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment — design","text":"","code":"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] 16 19 23 27 28 35 37 42 54 64 74 86 90 91 92 94 96 100 106 #> [20] 116 119 120 122 124 127 128 136 137 139 154 156 159 178 181 202 204 205 207 #> [39] 208 209 212 218 219 222 223 226 229 237 #> #> $SubSet2 #> [1] 11 13 24 26 34 45 47 58 59 69 75 83 84 88 89 97 103 109 110 #> [20] 118 129 130 142 145 146 149 152 153 160 162 166 171 175 179 184 187 191 193 #> [39] 194 197 199 200 210 220 228 231 234 235 #> #> $SubSet3 #> [1] 1 9 12 14 15 17 20 21 29 30 31 38 43 44 46 48 52 53 55 #> [20] 60 67 76 79 80 82 95 98 107 112 133 138 144 147 150 151 157 169 174 #> [39] 176 188 190 198 206 216 221 227 236 #> #> $SubSet4 #> [1] 2 8 10 18 22 25 32 33 36 39 40 41 49 51 56 61 62 63 68 #> [20] 72 73 93 99 101 104 108 113 126 131 132 134 140 141 143 148 163 164 165 #> [39] 167 180 182 186 189 201 203 224 232 #> #> $SubSet5 #> [1] 3 4 5 6 7 50 57 65 66 70 71 77 78 81 85 87 102 105 111 #> [20] 114 115 117 121 123 125 135 155 158 161 168 170 172 173 177 183 185 192 195 #> [39] 196 211 213 214 215 217 225 230 233 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribution by batch — distribution","title":"Distribution by batch — distribution","text":"Checks values maximally distributed several batches. Aimed categorical variables.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribution by batch — distribution","text":"","code":"distribution(report, column)"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribution by batch — distribution","text":"report data.frame must contain batch column. can obtained inspect(). column name column one wants inspect.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribution by batch — distribution","text":"TRUE values maximal distributed, otherwise FALSE.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribution by batch — distribution","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") nas <- c(137, 70) # Omit rows with NA to avoid warnings in design index <- design(pheno = survey[-nas, columns], size_subset = 70, iterations = 10) batches <- inspect(index, survey[-nas, columns]) distribution(batches, \"Sex\") #> [1] TRUE distribution(batches, \"Smoke\") #> [1] TRUE"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the entropy — entropy","title":"Calculates the entropy — entropy","text":"Calculates entropy category. uses amount categories scale 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the entropy — entropy","text":"","code":"entropy(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the entropy — entropy","text":"x character vector two categories","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the entropy — entropy","text":"numeric value Shannon entropy scaled 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculates the entropy — entropy","text":"omits NA present.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculates the entropy — entropy","text":"","code":"entropy(c(\"H\", \"T\", \"H\", \"T\")) #> [1] 1 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", \"H\")) #> [1] 0.8631206 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", NA)) #> [1] 0.9182958 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\")) #> [1] 0.9182958 entropy(c(\"H\", \"H\", \"H\", \"H\", \"H\", \"H\", NA)) #> [1] 0"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate entropy — evaluate_entropy","title":"Evaluate entropy — evaluate_entropy","text":"Looks nominal character columns equally distributed according entropy taking account independence batches. column different row assumed sample names thus omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate entropy — evaluate_entropy","text":"","code":"evaluate_entropy(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate entropy — evaluate_entropy","text":"list numeric indices data.frame pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate entropy — evaluate_entropy","text":"Value minimize","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate entropy — evaluate_entropy","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_entropy(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.007264842 0.481002114"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare independence by chisq.test — evaluate_independence","title":"Compare independence by chisq.test — evaluate_independence","text":"Looks independence categories batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"evaluate_independence(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare independence by chisq.test — evaluate_independence","text":"Index subsets. pheno data.frame information samples.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare independence by chisq.test — evaluate_independence","text":"Returns vector p-values chisq.test category subset.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_independence(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.09211905 0.50037711"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates a data.frame — evaluate_index","title":"Evaluates a data.frame — evaluate_index","text":"Measures several indicators per group","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates a data.frame — evaluate_index","text":"","code":"evaluate_index(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates a data.frame — evaluate_index","text":"Index pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates a data.frame — evaluate_index","text":"array three dimensions mean, standard deviation (sd()), median absolute deviation (mad()) numeric variables, entropy categorical number NA subgroup.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates a data.frame — evaluate_index","text":"","code":"data(survey, package = \"MASS\") index <- create_subset(nrow(survey), 50, 5) ev_index <- evaluate_index(index, survey[, c(\"Sex\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). ev_index[\"entropy\", , ] #> subgroups #> variables SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> Sex 0.9949848 0.9544340 1.0000000 0.9970591 0.9918208 #> Smoke 0.4001934 0.4855790 0.4487245 0.6082579 0.5376809 #> mix_cat 0.6660806 0.6605638 0.6587911 0.7305701 0.7266037"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate median absolute deviation — evaluate_mad","title":"Evaluate median absolute deviation — evaluate_mad","text":"Looks median absolute deviation values subgroup.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"evaluate_mad(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate median absolute deviation — evaluate_mad","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate median absolute deviation — evaluate_mad","text":"vector mean difference median absolute deviation group original mad.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mad(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 25.90814"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_mean","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"Looks mean numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"evaluate_mean(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"matrix mean value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mean(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 0.2733898"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate the dispersion of NAs — evaluate_na","title":"Evaluate the dispersion of NAs — evaluate_na","text":"Looks NA distributed subset","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"evaluate_na(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate the dispersion of NAs — evaluate_na","text":"list numeric indices data.frame pheno Data.frame","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate the dispersion of NAs — evaluate_na","text":"optimum value reduce","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"samples <- 10 m <- matrix(rnorm(samples), nrow = samples) m[sample(seq_len(samples), size = 5), ] <- NA # Some NA i <- create_subset(samples, 3, 4) # random subsets evaluate_na(i, m) #> [1] 0.375"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate each variable provided — evaluate_orig","title":"Evaluate each variable provided — evaluate_orig","text":"Measure summary statistics whole cohort samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"evaluate_orig(pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate each variable provided — evaluate_orig","text":"pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate each variable provided — evaluate_orig","text":"matrix mean, standard deviation, MAD values numeric variables, entropy categorical, amount NA per variable.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"data(survey, package = \"MASS\") evaluate_orig(survey[, c(\"Sex\", \"Age\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). #> Sex Age Smoke mix_cat #> mean 0 20.374515 0.0000000 0.0000000 #> sd 0 6.474335 0.0000000 0.0000000 #> mad 0 1.605656 0.0000000 0.0000000 #> na 1 0.000000 1.0000000 0.0000000 #> entropy 1 0.000000 0.5143828 0.6268135 #> independence 0 0.000000 0.0000000 0.0000000"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_sd","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"Looks standard deviation numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"evaluate_sd(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"List indices pheno Data.frame samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"matrix standard deviation value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_sd(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 1.647705"},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":null,"dir":"Reference","previous_headings":"","what":"experDesign: Expert experiment design in batches — experDesign-package","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Enables easy distribution samples per batch avoiding batch confounding effects randomization variables batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"important function design(), distributes samples batches according information provided. help bench inspect() function appends group data provided. grid spatial data, might want look spatial() function distribute samples keeping original design. case experiment half processed need extend can use follow_up() follow_up2(). helps selecting samples already used used follow .","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Lluís Revilla","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Select the subset of extreme cases to evaluation — extreme_cases","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"Subset samples mostly different.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"extreme_cases(pheno, size, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"pheno Data.frame sample information. size number samples subset. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"vector number rows selected.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) sel <- extreme_cases(metadata, 10) # We can see that it selected both Female and Males and wide range of height # and weight: metadata[sel, ] #> height weight sex #> 1 60 100 Male #> 4 75 100 Male #> 5 80 100 Male #> 13 70 200 Male #> 14 75 200 Male #> 21 60 300 Male #> 25 80 300 Male #> 29 75 100 Female #> 47 65 300 Female #> 48 70 300 Female"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments — follow_up","title":"Follow up experiments — follow_up","text":"experiment carried samples want continue samples later .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments — follow_up","text":"","code":"follow_up( original, follow_up, size_subset, omit = NULL, old_new = \"batch\", iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments — follow_up","text":"original data.frame information samples used originally. follow_up data.frame information new samples. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. old_new Name column batch status stored. matches name column original used find previous batches. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments — follow_up","text":"data.frame common columns data, new column old_new, batch column filled new batches needed.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments — follow_up","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] fu <- follow_up(survey1, survey2, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> Warning: Column batch is already present. Did you meant this?"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments in batches — follow_up2","title":"Follow up experiments in batches — follow_up2","text":"Design experiment data new old together.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments in batches — follow_up2","text":"","code":"follow_up2(all_data, batch_column = \"batch\", ...)"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments in batches — follow_up2","text":"all_data data.frame data samples. row sample. batch_column name column all_data batches used. NA interpreted new data, empty considered batch. ... Arguments passed design size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments in batches — follow_up2","text":"data.frame batch_column filled new batches needed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Follow up experiments in batches — follow_up2","text":"batch_column empty samples considered new. size_subset missing, estimated previous batch Similarly, iterations name guessed inferred samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments in batches — follow_up2","text":"","code":"data(survey, package = \"MASS\") # Create the first batch first_batch_n <- 118 variables <- c(\"Sex\", \"Smoke\", \"Age\") survey1 <- survey[seq_len(first_batch_n), variables] index1 <- design(survey1, size_subset = 50, iterations = 10) #> Warning: There might be some problems with the data use check_data(). r_survey <- inspect(index1, survey1) # Create the second batch with \"new\" students survey2 <- survey[seq(from = first_batch_n +1, to = nrow(survey)), variables] survey2$batch <- NA # Prepare the follow up all_classroom <- rbind(r_survey, survey2) follow_up2(all_classroom, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet1\" #> [6] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [11] \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet1\" #> [16] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [21] \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [26] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [31] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [36] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet3\" #> [41] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [46] \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [51] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet2\" #> [56] \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [61] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [66] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" #> [71] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [76] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet2\" #> [81] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [86] \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [91] \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet2\" #> [96] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [101] \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" #> [106] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [111] \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [116] \"SubSet3\" \"SubSet1\" \"SubSet3\" \"NewSubset1\" \"NewSubset3\" #> [121] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" #> [126] \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [131] \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [136] \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" #> [141] \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [146] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset2\" #> [151] \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" #> [156] \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [161] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [166] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" #> [171] \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset2\" #> [176] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [181] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [186] \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [191] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" #> [196] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" #> [201] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [206] \"NewSubset3\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [211] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" #> [216] \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" #> [221] \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [226] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [231] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [236] \"NewSubset2\" \"NewSubset1\""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":null,"dir":"Reference","previous_headings":"","what":"Inspect the index — inspect","title":"Inspect the index — inspect","text":"Given index data samples append batch assignment","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inspect the index — inspect","text":"","code":"inspect(i, pheno, omit = NULL, index_name = \"batch\")"},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inspect the index — inspect","text":"List indices samples per batch pheno Data.frame sample information. omit Name columns pheno omitted. index_name Column name index resulting data.frame.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inspect the index — inspect","text":"data.frame new column batch name batch sample goes .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inspect the index — inspect","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") index <- design(pheno = survey[, columns], size_subset = 70, iterations = 10) #> Warning: There might be some problems with the data use check_data(). batches <- inspect(index, survey[, columns]) head(batches) #> Sex Age Smoke batch #> 1 Female 18.250 Never SubSet3 #> 2 Male 17.583 Regul SubSet4 #> 3 Male 16.917 Occas SubSet3 #> 4 Male 20.333 Never SubSet4 #> 5 Male 23.667 Never SubSet3 #> 6 Female 21.000 Never SubSet4"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":null,"dir":"Reference","previous_headings":"","what":"Optimum values for batches — optimum","title":"Optimum values for batches — optimum","text":"Calculates optimum values number batches size batches. need several batches can better distribute evenly add replicates.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optimum values for batches — optimum","text":"","code":"optimum_batches(size_data, size_subset) optimum_subset(size_data, batches) sizes_batches(size_data, size_subset, batches)"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optimum values for batches — optimum","text":"size_data numeric value number samples use. size_subset Numeric value number sample per batch. batches numeric value number batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optimum values for batches — optimum","text":"optimum_batches numeric value number batches use. optimum_subset numeric value maximum number samples per batch data. sizes_batches numeric vector number samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Optimum values for batches — optimum","text":"","code":"size_data <- 50 size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) #> [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) #> [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) #> [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":null,"dir":"Reference","previous_headings":"","what":"Random subset — qcSubset","title":"Random subset — qcSubset","text":"Select randomly samples index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random subset — qcSubset","text":"","code":"qcSubset(index, size, each = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random subset — qcSubset","text":"index list indices indicating samples go subset. size number samples taken. logical value subset taken samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random subset — qcSubset","text":"","code":"set.seed(50) index <- create_subset(100, 50, 2) QC_samples <- qcSubset(index, 10) QC_samplesBatch <- qcSubset(index, 10, TRUE)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment with experimental controls — replicates","title":"Design a batch experiment with experimental controls — replicates","text":"ensure batches comparable samples processed batch. function allows take account effect. uses different samples controls defined extreme_cases().","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"replicates(pheno, size_subset, controls, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment with experimental controls — replicates","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. controls numeric value amount technical controls per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment with experimental controls — replicates","text":"index samples duplicated batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Design a batch experiment with experimental controls — replicates","text":"control variance replicates important, see example https://www.nature.com/articles/nmeth.3091.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"samples <- data.frame(L = letters[1:25], Age = rnorm(25), type = sample(LETTERS[1:5], 25, TRUE)) index <- replicates(samples, 5, controls = 2, omit = \"L\", iterations = 10) head(index) #> $SubSet1 #> [1] 1 7 12 19 21 #> #> $SubSet2 #> [1] 2 4 17 19 21 #> #> $SubSet3 #> [1] 6 18 19 21 25 #> #> $SubSet4 #> [1] 5 19 21 22 23 #> #> $SubSet5 #> [1] 3 8 11 19 21 #> #> $SubSet6 #> [1] 10 19 21 24 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribute the sample on the plate — spatial","title":"Distribute the sample on the plate — spatial","text":"function assumes process batch samples distributed plate grid scheme.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribute the sample on the plate — spatial","text":"","code":"spatial( index, pheno, omit = NULL, remove_positions = NULL, rows = LETTERS[1:5], columns = 1:10, iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribute the sample on the plate — spatial","text":"index list samples subgroup, provided design() replicates(). pheno Data.frame sample information. omit Name columns pheno omitted. remove_positions Character, name positions avoided grid. rows Character, name rows used. columns Character, name rows used. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribute the sample on the plate — spatial","text":"indices samples go batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribute the sample on the plate — spatial","text":"","code":"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(). index2 <- spatial(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")], iterations = 10) head(index2) #> $A1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 8 207 16 107 150 #> #> $B1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 100 154 222 161 105 #> #> $C1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 88 163 209 71 1 #> #> $D1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 114 208 70 9 36 #> #> $E1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 86 112 15 171 221 #> #> $A2 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 176 224 46 133 235 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a factor to index — use_index","title":"Convert a factor to index — use_index","text":"Convert given factor accepted index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a factor to index — use_index","text":"","code":"use_index(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a factor to index — use_index","text":"x character factor used index","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert a factor to index — use_index","text":"","code":"plates <- c(\"P1\", \"P2\", \"P1\", \"P2\", \"P2\", \"P3\", \"P1\", \"P3\", \"P1\", \"P1\") use_index(plates) #> $P1 #> [1] 1 3 7 9 10 #> #> $P2 #> [1] 2 4 5 #> #> $P3 #> [1] 6 8 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":null,"dir":"Reference","previous_headings":"","what":"Check the data for a follow up experiment. — valid_followup","title":"Check the data for a follow up experiment. — valid_followup","text":"Sometimes samples collected analyzed, later another batch samples analyzed. function tries detect problems data data combined single analysis. know specific problems data need use check_data()","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"valid_followup( old_data = NULL, new_data = NULL, all_data = NULL, omit = NULL, column = \"batch\" )"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check the data for a follow up experiment. — valid_followup","text":"old_data, new_data data.frame old new data respectively. all_data data.frame data samples. row sample. omit Name columns pheno omitted. column name column old data batch information, whether data new (NA) case all_data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check the data for a follow up experiment. — valid_followup","text":"Called side effects warnings, returns logical value issues (FALSE) (TRUE)","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] valid_followup(survey1, survey2) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE survey$batch <- NA survey$batch[1:118] <- \"old\" valid_followup(all_data = survey) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-development-version","dir":"Changelog","previous_headings":"","what":"experDesign (development version)","title":"experDesign (development version)","text":"Check index used inspect valid length, positions replications matching data provided. check_data() gains new omit argument (#49). relied positional arguments break scripts. Omitting non existing columns now creates warning.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-030","dir":"Changelog","previous_headings":"","what":"experDesign 0.3.0","title":"experDesign 0.3.0","text":"CRAN release: 2024-02-20 Fixed bug spatial() multiple samples assigned position plate (#45). Added warning batch_names() index repeated positions (revealed #45).","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-020","dir":"Changelog","previous_headings":"","what":"experDesign 0.2.0","title":"experDesign 0.2.0","text":"CRAN release: 2023-04-05 New follow_up() follow_up2() continue experiment safely (#22). New check_data() check input data (#37). New compare_index() compare different indexes per batch. Use categories combined (column mix_cat) comparing batches. Increased internal coherence checks. Added thesis advisers description. Update documentation.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-010","dir":"Changelog","previous_headings":"","what":"experDesign 0.1.0","title":"experDesign 0.1.0","text":"CRAN release: 2021-04-22 Added reference new package Omixer README. Fixed batches sizes errors. Speed increase (5x) design, spatial replicates. Update Code Conduct. Add online documentation url.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-004","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.4","title":"experDesign 0.0.4","text":"CRAN release: 2020-09-28 Remove BiocStyle dependency. Gain ability name subsets. Add examples functions. Add function consider spatial distribution plates/machines.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-002","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.2","title":"experDesign 0.0.2","text":"CRAN release: 2020-09-08 CRAN release","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-0009000","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.0.9000","title":"experDesign 0.0.0.9000","text":"Added NEWS.md file track changes package.","code":""}]
vignettes/experdesign.Rmd
experdesign.Rmd
spati <- spatial(repli, metadata, rows = LETTERS[1:6], columns = 1:4) head(spati) ## $A1 -## [1] 21 5 11 +## SubSet1 SubSet2 SubSet3 +## 32 43 56 ## ## $B1 -## NULL +## SubSet1 SubSet2 SubSet3 +## 3 37 27 ## ## $C1 -## [1] 58 13 33 +## SubSet1 SubSet2 SubSet3 +## 34 29 28 ## ## $D1 -## [1] 35 +## SubSet1 SubSet2 SubSet3 +## 36 5 60 ## ## $E1 -## [1] 3 8 15 +## SubSet1 SubSet2 SubSet3 +## 52 13 33 ## ## $F1 -## [1] 9 19 53
And now we can see the batch and position of each sample
As many of the variables for multiple subsets are negative it shows that desi is better.
desi
We can see that in this simple case where a single variable has all the other cases we approximately reached the same entropy levels.
You can also test a given index with check_index():
check_index()
check_index(unbalanced, i) @@ -412,15 +418,15 @@ Quality check## data use check_data(). ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 SubSet6 -## Classroom 0.02244529 0.03105896 0.02629978 0.02137583 0.02137583 0.02629978 -## Sex 0.16047517 0.22439953 0.16047517 0.16047517 0.16047517 0.16047517 -## Age 0.42561876 0.23886131 0.43542914 0.19353035 0.12717736 0.34552062 -## mix_cat 0.08031059 0.02527493 0.07741971 0.08111268 0.08111268 0.07741971 +## Classroom 0.02116629 0.02116629 0.04000152 0.04000152 0.06572331 0.02009684 +## Sex 0.17853702 0.17853702 0.24841904 0.17853702 0.17853702 0.17853702 +## Age 0.20351157 0.19733814 0.25375813 0.28706685 0.12655149 0.14621487 +## mix_cat 0.08031059 0.08031059 0.03045638 0.06618417 0.04689282 0.08111268 ## subgroups ## SubSet7 -## Classroom 0.02629978 -## Sex 0.16047517 -## Age 0.25569779 +## Classroom 0.02502079 +## Sex 0.17853702 +## Age 0.45676502 ## mix_cat 0.07741971
Each row has information about how accurate is a given variable to the samples available (on this case unbalanced). Some @@ -457,28 +463,28 @@
unbalanced
We can measure how does this index does:
score_index1 <- check_index(survey[, keep], index) @@ -487,11 +493,11 @@ Internalsscore_index1 ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 -## Sex 0.183272313 0.18307418 0.18473404 0.34995773 -## W.Hnd 0.201330461 0.38189871 0.16814879 0.16765764 -## Smoke 0.384839974 0.51271703 0.34958370 0.36736401 -## Age 0.247117147 0.86678868 0.69125158 0.51061368 -## mix_cat 0.006173258 0.01392375 0.01709306 0.03849348
These values come from calculating the difference between the original data and the samples for each subset for the median, mean, mad, NA, entropy and independence (chisq.test() p.value).
chisq.test()
If this score is lower than the previous one the new index is kept.
This is done similarly for the spatial search, which adds two new @@ -538,12 +544,12 @@
Revilla Sancho L (????). experDesign: Design Experiments for Batches. -R package version 0.3.0.9001, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. +R package version 0.3.0.9002, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev.
@Manual{, title = {experDesign: Design Experiments for Batches}, author = {Lluís {Revilla Sancho}}, - note = {R package version 0.3.0.9001, https://github.com/llrs/experDesign/}, + note = {R package version 0.3.0.9002, https://github.com/llrs/experDesign/}, url = {https://experdesign.llrs.dev}, }
Revilla Sancho L, Lozano J, Salas Martinez A (2021). diff --git a/dev/index.html b/dev/index.html index c022a17..5078f33 100644 --- a/dev/index.html +++ b/dev/index.html @@ -30,7 +30,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/news/index.html b/dev/news/index.html index 2f79dee..7449385 100644 --- a/dev/news/index.html +++ b/dev/news/index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 11c6b5a..4af69b5 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.9 pkgdown_sha: ~ articles: experdesign: experdesign.html -last_built: 2024-04-30T09:35Z +last_built: 2024-05-07T16:25Z urls: reference: https://experdesign.llrs.dev/reference article: https://experdesign.llrs.dev/articles diff --git a/dev/reference/batch_names.html b/dev/reference/batch_names.html index a268cce..97a63a4 100644 --- a/dev/reference/batch_names.html +++ b/dev/reference/batch_names.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/check_data.html b/dev/reference/check_data.html index a5d968c..8a9a0a0 100644 --- a/dev/reference/check_data.html +++ b/dev/reference/check_data.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/check_index.html b/dev/reference/check_index.html index 1328851..39fcc20 100644 --- a/dev/reference/check_index.html +++ b/dev/reference/check_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/compare_index.html b/dev/reference/compare_index.html index ba4d9a2..212e1b6 100644 --- a/dev/reference/compare_index.html +++ b/dev/reference/compare_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/create_subset.html b/dev/reference/create_subset.html index 8639455..2f3259b 100644 --- a/dev/reference/create_subset.html +++ b/dev/reference/create_subset.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/design.html b/dev/reference/design.html index d3b9cce..b16f607 100644 --- a/dev/reference/design.html +++ b/dev/reference/design.html @@ -14,7 +14,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/distribution.html b/dev/reference/distribution.html index 63ffa22..4033da7 100644 --- a/dev/reference/distribution.html +++ b/dev/reference/distribution.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/entropy.html b/dev/reference/entropy.html index b55b565..f1e4bea 100644 --- a/dev/reference/entropy.html +++ b/dev/reference/entropy.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_entropy.html b/dev/reference/evaluate_entropy.html index 31c7447..2b46129 100644 --- a/dev/reference/evaluate_entropy.html +++ b/dev/reference/evaluate_entropy.html @@ -16,7 +16,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_independence.html b/dev/reference/evaluate_independence.html index 8ef844f..0b3e2d0 100644 --- a/dev/reference/evaluate_independence.html +++ b/dev/reference/evaluate_independence.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_index.html b/dev/reference/evaluate_index.html index e8b05ca..87b4368 100644 --- a/dev/reference/evaluate_index.html +++ b/dev/reference/evaluate_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_mad.html b/dev/reference/evaluate_mad.html index b8be2c7..b29ae62 100644 --- a/dev/reference/evaluate_mad.html +++ b/dev/reference/evaluate_mad.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_mean.html b/dev/reference/evaluate_mean.html index db61515..67f78f5 100644 --- a/dev/reference/evaluate_mean.html +++ b/dev/reference/evaluate_mean.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_na.html b/dev/reference/evaluate_na.html index de11ea0..c717283 100644 --- a/dev/reference/evaluate_na.html +++ b/dev/reference/evaluate_na.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_orig.html b/dev/reference/evaluate_orig.html index fb0ab10..dd2667f 100644 --- a/dev/reference/evaluate_orig.html +++ b/dev/reference/evaluate_orig.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/evaluate_sd.html b/dev/reference/evaluate_sd.html index 160a83f..4461588 100644 --- a/dev/reference/evaluate_sd.html +++ b/dev/reference/evaluate_sd.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/experDesign-package.html b/dev/reference/experDesign-package.html index c49a3b6..2080808 100644 --- a/dev/reference/experDesign-package.html +++ b/dev/reference/experDesign-package.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/extreme_cases.html b/dev/reference/extreme_cases.html index 0870b20..730848c 100644 --- a/dev/reference/extreme_cases.html +++ b/dev/reference/extreme_cases.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/follow_up.html b/dev/reference/follow_up.html index 4b409a7..bc65c2e 100644 --- a/dev/reference/follow_up.html +++ b/dev/reference/follow_up.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/follow_up2.html b/dev/reference/follow_up2.html index 37609bd..938521b 100644 --- a/dev/reference/follow_up2.html +++ b/dev/reference/follow_up2.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/index.html b/dev/reference/index.html index 378f0fd..7fc3f38 100644 --- a/dev/reference/index.html +++ b/dev/reference/index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/inspect.html b/dev/reference/inspect.html index 0021169..75c0a76 100644 --- a/dev/reference/inspect.html +++ b/dev/reference/inspect.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/optimum.html b/dev/reference/optimum.html index ea9a1f7..41ff7e2 100644 --- a/dev/reference/optimum.html +++ b/dev/reference/optimum.html @@ -14,7 +14,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/qcSubset.html b/dev/reference/qcSubset.html index 811684a..6c191ce 100644 --- a/dev/reference/qcSubset.html +++ b/dev/reference/qcSubset.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/replicates.html b/dev/reference/replicates.html index 58770a2..a555beb 100644 --- a/dev/reference/replicates.html +++ b/dev/reference/replicates.html @@ -14,7 +14,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/spatial.html b/dev/reference/spatial.html index ecb7b4a..8bf0d06 100644 --- a/dev/reference/spatial.html +++ b/dev/reference/spatial.html @@ -12,7 +12,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 @@ -124,22 +124,28 @@ Examplesindex2 <- spatial(index, survey[, c("Sex", "Smoke", "Age")], iterations = 10) head(index2) #> $A1 -#> [1] 86 131 52 76 1 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 8 207 16 107 150 #> #> $B1 -#> [1] 27 130 124 133 175 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 100 154 222 161 105 #> #> $C1 -#> [1] 74 21 110 161 99 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 88 163 209 71 1 #> #> $D1 -#> [1] 162 48 158 108 233 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 114 208 70 9 36 #> #> $E1 -#> [1] 141 234 222 166 127 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 86 112 15 171 221 #> #> $A2 -#> [1] 100 49 227 29 125 +#> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 +#> 176 224 46 133 235 #> diff --git a/dev/reference/use_index.html b/dev/reference/use_index.html index 3614039..47fd407 100644 --- a/dev/reference/use_index.html +++ b/dev/reference/use_index.html @@ -10,7 +10,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/reference/valid_followup.html b/dev/reference/valid_followup.html index 1bca148..fd9282a 100644 --- a/dev/reference/valid_followup.html +++ b/dev/reference/valid_followup.html @@ -18,7 +18,7 @@ experDesign - 0.3.0.9001 + 0.3.0.9002 diff --git a/dev/search.json b/dev/search.json index 3f4bf27..c1d7a66 100644 --- a/dev/search.json +++ b/dev/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement package’s maintainer email. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://experdesign.llrs.dev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2018 Lluís Revilla Sancho Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"exprDesign","text":"package developed help prepare samples send facility. assumes collected samples information still need experiment several batches due technical practical limitations. question tries answer : samples go batch? possible combinations samples, looks combination minimizes differences subgroup according following rules: variable categorical tires randomize variable across subgroups. variable numeric tries distribute evenly following original distribution values. NA (available values) looks distribute randomly. Even measures might end batch effect due : - Confounding variables provided randomization batches Sometimes due unknown, impossible measure. - Lack replicates(samples conditions) can’t provide new replicates, aim provide technical replicates. Technical replicates mean reanalyzing sample twice , samples technical replicates accurate measures easier avoid detect batch effects. - Processing change methodology, pause resume later sample collection might changes outcome due external factors.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"previous-work","dir":"Articles","previous_headings":"","what":"Previous work","title":"exprDesign","text":"building package like give credit made also efforts direction: CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"DoE","dir":"Articles","previous_headings":"","what":"Design of Experiment","title":"exprDesign","text":"Imagine samples already collected want distributed batches: First can check data see concerns regarding categories: none confounding variables artificial dataset (see examples, ’ll find ). However, block incorrectly end group single batch end batch effect. order avoid design() helps assign sample batch (case batch 24 samples ). First can explore number samples number batches: Note instead using whole batch leave single sample third distributes samples three batches needed.","code":"library(\"experDesign\") metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) head(metadata, 15) ## height weight sex ## 1 60 100 Male ## 2 65 100 Male ## 3 70 100 Male ## 4 75 100 Male ## 5 80 100 Male ## 6 60 150 Male ## 7 65 150 Male ## 8 70 150 Male ## 9 75 150 Male ## 10 80 150 Male ## 11 60 200 Male ## 12 65 200 Male ## 13 70 200 Male ## 14 75 200 Male ## 15 80 200 Male check_data(metadata) ## [1] TRUE size_data <- nrow(metadata) size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) ## [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) ## [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) ## [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization","dir":"Articles","previous_headings":"","what":"Randomization","title":"exprDesign","text":"can directly look distribution samples given max number samples per batch: Naively one either fill batches fully distribute evenly (first 17 packages together, next 17 ). solution ensures data randomized. random distribution can increase number iterations performed calculate distribution.","code":"desi <- design(metadata, size_batch) # It is a list but we can convert it to a vector with: batch_names(desi) ## [1] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" ## [8] \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" ## [15] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" ## [22] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" ## [29] \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" ## [36] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" ## [43] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" ## [50] \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization-and-replicates","dir":"Articles","previous_headings":"","what":"Randomization and replicates","title":"exprDesign","text":"need space replicates control batch effect can use: seeks controls diverse values adds samples distribution. Note sample already present batch added , ’s number samples per batch different design without replicates.","code":"repli <- replicates(metadata, size_batch, 5) lengths(repli) ## SubSet1 SubSet2 SubSet3 ## 21 21 18 repli ## $SubSet1 ## [1] 3 9 10 16 17 20 27 28 30 31 32 33 34 35 40 41 42 44 45 48 49 ## ## $SubSet2 ## [1] 4 5 7 8 9 10 13 15 18 21 22 25 26 32 33 34 36 37 38 39 47 ## ## $SubSet3 ## [1] 1 2 6 9 10 11 12 14 19 23 24 29 32 33 34 43 46 50"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"layout","dir":"Articles","previous_headings":"","what":"Layout","title":"exprDesign","text":"can analyze samples distributed layout 6x4:","code":"spati <- spatial(repli, metadata, rows = LETTERS[1:6], columns = 1:4) head(spati) ## $A1 ## [1] 21 5 11 ## ## $B1 ## NULL ## ## $C1 ## [1] 58 13 33 ## ## $D1 ## [1] 35 ## ## $E1 ## [1] 3 8 15 ## ## $F1 ## [1] 9 19 53"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"report-for-easy-on-field-usage","dir":"Articles","previous_headings":"","what":"Report for easy on field usage","title":"exprDesign","text":"can add batches initial data inspect(): now can see batch position sample","code":"report <- inspect(repli, metadata) report2 <- inspect(spati, report, index_name = \"position\") head(report2) ## height weight sex batch position ## 1 60 100 Male SubSet3 A1 ## 2 65 100 Male SubSet3 A1 ## 3 70 100 Male SubSet1 A1 ## 4 75 100 Male SubSet2 C1 ## 5 80 100 Male SubSet2 C1 ## 6 60 150 Male SubSet3 C1"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"compare-indices","dir":"Articles","previous_headings":"","what":"Compare indices","title":"exprDesign","text":"two indices can also compare : many variables multiple subsets negative shows desi better.","code":"desi2 <- create_subset(nrow(metadata), size_batch) compare_index(metadata, desi, desi2) ## subgroups ## SubSet1 SubSet2 SubSet3 ## height -0.003378784 -0.4899827 -1.3652524 ## weight -5.083194894 -5.0202051 -12.6611209 ## sex 0.085527089 0.1267009 0.1152791"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"unbalanced-setting","dir":"Articles","previous_headings":"","what":"Unbalanced setting","title":"exprDesign","text":"previous case data mostly balanced (check orig object) let’s create unbalanced dataset check . dataset one female, resulting classroom full males. Age independent sex classroom. can see simple case single variable cases approximately reached entropy levels.","code":"n <- 99 samples <- 100 unbalanced <- data.frame(Classroom = rep(c(\"A\", \"B\"), each = samples/2), Sex = c(rep(\"M\", n), rep(\"F\", samples-n)), Age = rnorm(samples, mean = 25, sd = 3)) table(unbalanced[, 1:2]) ## Sex ## Classroom F M ## A 0 50 ## B 1 49 i <- design(unbalanced, 15) ## Warning: There might be some problems with the data use check_data(). evaluation <- evaluate_index(i, unbalanced) ## Warning: There might be some problems with the data use check_data(). # Mean entropy en each subset rowMeans(evaluation[\"entropy\", , ]) ## Classroom Sex Age mix_cat ## 0.98906095 0.05047991 0.00000000 0.96130358 # Original entropy on the dataset evaluate_orig(unbalanced)[\"entropy\", ] ## Warning in evaluate_orig(unbalanced): There might be some problems with the ## data use check_data(). ## Classroom Sex Age mix_cat ## 1.00000000 0.08079314 0.00000000 0.67554928 # Dispersion of the entropy apply(evaluation[\"entropy\", , ], 1, sd) ## Classroom Sex Age mix_cat ## 0.01057627 0.13355727 0.00000000 0.08171973"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"quality-check","dir":"Articles","previous_headings":"","what":"Quality check","title":"exprDesign","text":"need subset samples diverse can use following function: can also test given index check_index(): row information accurate given variable samples available (case unbalanced). variables distributed randomly others index. satisfied design() new index increasing iterations obtain potentially better distribution. want good stratified randomization increase iterations used 10 fold.","code":"data(survey, package = \"MASS\") head(survey) ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric ## 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial ## 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA ## 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric ## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric ## 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial ## Age ## 1 18.250 ## 2 17.583 ## 3 16.917 ## 4 20.333 ## 5 23.667 ## 6 21.000 samples <- extreme_cases(survey, size = 10) survey[samples, ] ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 41 Female 17.5 16.0 Right L on R NA Right Some Never 169.00 Metric ## 52 Male 20.5 20.0 Right L on R 68 Right Freq Never 190.00 Metric ## 76 Female 17.5 17.5 Right Neither 68 Right Freq Heavy 170.00 Metric ## 82 Male 19.2 18.9 Right R on L 76 Right Freq Never 176.50 Imperial ## 93 Female 18.2 17.5 Right L on R 70 Right Some Never 165.00 Metric ## 137 19.8 19.0 Left L on R 73 Neither Freq Never 172.00 Metric ## 139 Male 20.0 19.5 Right L on R NA Right Freq Never 170.00 Metric ## 142 Female 18.3 19.0 Right R on L NA Right None Never 165.00 Metric ## 154 Male 21.5 21.6 Right R on L 69 Right Freq Never 172.72 Imperial ## 221 Male 23.2 23.3 Right L on R NA Right None Heavy 171.00 Metric ## Age ## 41 17.500 ## 52 17.500 ## 76 20.667 ## 82 20.167 ## 93 19.667 ## 137 21.500 ## 139 21.417 ## 142 21.083 ## 154 70.417 ## 221 20.917 check_index(unbalanced, i) ## Warning in check_index(unbalanced, i): There might be some problems with the ## data use check_data(). ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 SubSet6 ## Classroom 0.02244529 0.03105896 0.02629978 0.02137583 0.02137583 0.02629978 ## Sex 0.16047517 0.22439953 0.16047517 0.16047517 0.16047517 0.16047517 ## Age 0.42561876 0.23886131 0.43542914 0.19353035 0.12717736 0.34552062 ## mix_cat 0.08031059 0.02527493 0.07741971 0.08111268 0.08111268 0.07741971 ## subgroups ## SubSet7 ## Classroom 0.02629978 ## Sex 0.16047517 ## Age 0.25569779 ## mix_cat 0.07741971"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"internals","dir":"Articles","previous_headings":"","what":"Internals","title":"exprDesign","text":"check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can measure index : values come calculating difference original data samples subset median, mean, mad, NA, entropy independence (chisq.test() p.value). values meaning, internally used compare possible index: compares previous index score lower previous one new index kept. done similarly spatial search, adds two new categorical variables position samples calculating statistics.","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) ## [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) ## Sex W.Hnd Smoke Age ## 1 Female Right Never 18.250 ## 2 Male Left Regul 17.583 ## 3 Male Right Occas 16.917 ## 4 Male Right Never 20.333 ## 5 Male Right Never 23.667 ## 6 Female Right Never 21.000 # Set a seed for reproducibility # Looking for groups at most of 70 samples. index <- create_subset(nrow(survey), size_subset = 70) index ## $SubSet1 ## [1] 6 13 14 15 16 17 20 26 32 34 37 47 48 51 53 56 58 59 63 ## [20] 64 67 75 77 79 80 81 85 95 102 108 111 114 115 118 119 126 130 131 ## [39] 134 136 154 156 161 180 182 183 189 192 194 202 203 209 210 211 214 224 225 ## [58] 228 229 236 ## ## $SubSet2 ## [1] 3 4 5 8 12 19 22 24 25 28 31 38 45 46 66 68 70 72 78 ## [20] 82 87 91 97 98 104 106 107 112 121 128 129 141 142 149 150 152 153 159 ## [39] 163 165 166 167 174 176 184 188 190 191 195 198 212 216 219 221 223 231 232 ## [58] 234 237 ## ## $SubSet3 ## [1] 2 7 10 23 27 30 33 39 42 49 52 60 61 62 69 71 73 74 86 ## [20] 88 89 90 94 103 109 113 116 117 123 132 133 135 140 146 151 157 158 160 ## [39] 169 171 172 173 175 181 185 187 199 205 206 207 208 213 215 217 222 226 227 ## [58] 230 235 ## ## $SubSet4 ## [1] 1 9 11 18 21 29 35 36 40 41 43 44 50 54 55 57 65 76 83 ## [20] 84 92 93 96 99 100 101 105 110 120 122 124 125 127 137 138 139 143 144 ## [39] 145 147 148 155 162 164 168 170 177 178 179 186 193 196 197 200 201 204 218 ## [58] 220 233 score_index1 <- check_index(survey[, keep], index) ## Warning in check_index(survey[, keep], index): There might be some problems ## with the data use check_data(). score_index1 ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 ## Sex 0.183272313 0.18307418 0.18473404 0.34995773 ## W.Hnd 0.201330461 0.38189871 0.16814879 0.16765764 ## Smoke 0.384839974 0.51271703 0.34958370 0.36736401 ## Age 0.247117147 0.86678868 0.69125158 0.51061368 ## mix_cat 0.006173258 0.01392375 0.01709306 0.03849348 index2 <- create_subset(nrow(survey), size_subset = 70) score_index2 <- check_index(survey[, keep], index2) ## Warning in check_index(survey[, keep], index2): There might be some problems ## with the data use check_data(). sum(rowMeans(abs(score_index2-score_index1))) ## [1] 0.9367265"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"sessioninfo","dir":"Articles","previous_headings":"","what":"SessionInfo","title":"exprDesign","text":"","code":"sessionInfo() ## R version 4.4.0 (2024-04-24) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] experDesign_0.3.0.9001 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.46 rlang_1.1.3 ## [5] xfun_0.43 purrr_1.0.2 textshaping_0.3.7 jsonlite_1.8.8 ## [9] htmltools_0.5.8.1 ragg_1.3.0 sass_0.4.9 rmarkdown_2.26 ## [13] evaluate_0.23 jquerylib_0.1.4 fastmap_1.1.1 yaml_2.3.8 ## [17] lifecycle_1.0.4 memoise_2.0.1 compiler_4.4.0 fs_1.6.4 ## [21] systemfonts_1.0.6 digest_0.6.35 R6_2.5.1 magrittr_2.0.3 ## [25] bslib_0.7.0 tools_4.4.0 pkgdown_2.0.9 cachem_1.0.8 ## [29] desc_1.4.3"},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Lluís Revilla Sancho. Author, maintainer. Juanjo Lozano. Thesis advisor. Azucena Salas Martinez. Thesis advisor.","code":""},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Revilla Sancho L (????). experDesign: Design Experiments Batches. R package version 0.3.0.9001, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. Revilla Sancho L, Lozano J, Salas Martinez (2021). “experDesign: stratifying samples batches minimal bias.” Journal Open Source Software, 6(67), 6. doi:10.21105/joss.03358, https://joss.theoj.org/papers/10.21105/joss.03358.","code":"@Manual{, title = {experDesign: Design Experiments for Batches}, author = {Lluís {Revilla Sancho}}, note = {R package version 0.3.0.9001, https://github.com/llrs/experDesign/}, url = {https://experdesign.llrs.dev}, } @Article{, title = {experDesign: stratifying samples into batches with minimal bias}, doi = {10.21105/joss.03358}, author = {Lluís {Revilla Sancho} and Juanjo Lozano and Azucena {Salas Martinez}}, journal = {Journal of Open Source Software}, year = {2021}, volume = {6}, number = {67}, pages = {6}, url = {https://joss.theoj.org/papers/10.21105/joss.03358}, }"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"experdesign","dir":"","previous_headings":"","what":"Design experiments for batches","title":"Design experiments for batches","text":"goal experDesign help manage samples experiment collected. example, checking common problems data, help reduce even prevent batch bias performing experiment, measure already done provides four main functions: check_data(): Check problems data. design(): Randomize samples according variables. replicates(): Selects samples replicates randomizes samples (highly recommended). spatial(): Randomize samples spatial grid.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Design experiments for batches","text":"install latest version CRAN use: can install development version pkgdown GitHub :","code":"install.packages(\"experDesign\") # install.packages(\"devtools\") devtools::install_github(\"llrs/experDesign\")"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Design experiments for batches","text":"can use survey dataset examples: dataset numeric, categorical values NA values.","code":"library(\"experDesign\") data(survey, package = \"MASS\") head(survey) #> Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I #> 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric #> 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial #> 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA #> 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric #> 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric #> 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial #> Age #> 1 18.250 #> 2 17.583 #> 3 16.917 #> 4 20.333 #> 5 23.667 #> 6 21.000"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"checking-initial-data","dir":"","previous_headings":"Example","what":"Checking initial data","title":"Design experiments for batches","text":"can check issues experimental point view via check_data(): can see warnings get collections problems. general, try least 3 replicates condition try data variable.","code":"check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one #> sample. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"picking-samples-for-each-batch","dir":"","previous_headings":"Example","what":"Picking samples for each batch","title":"Design experiments for batches","text":"Imagine can work groups 70, want randomize Sex, Smoke, Age, hand. 1.6543999^{61} combinations samples per batch experiment. However, combinations right handed students batch making impossible compare right handed students others draw conclusions . check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can transform vector append file pass colleague :","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) #> [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) #> Sex W.Hnd Smoke Age #> 1 Female Right Never 18.250 #> 2 Male Left Regul 17.583 #> 3 Male Right Occas 16.917 #> 4 Male Right Never 20.333 #> 5 Male Right Never 23.667 #> 6 Female Right Never 21.000 # Set a seed for reproducibility set.seed(87732135) # Looking for groups at most of 70 samples. index <- design(pheno = survey, size_subset = 70, omit = omit, iterations = 100) #> Warning: There might be some problems with the data use check_data(). index #> $SubSet1 #> [1] 3 9 10 14 16 21 23 24 25 30 44 46 56 57 59 62 63 68 69 #> [20] 70 73 80 81 85 90 94 95 97 101 103 104 105 106 111 113 119 123 125 #> [39] 139 143 151 155 164 168 174 177 178 188 190 191 200 202 210 216 224 228 229 #> [58] 232 234 237 #> #> $SubSet2 #> [1] 5 6 11 18 19 22 31 34 37 38 39 40 41 47 49 53 54 55 58 #> [20] 60 65 66 71 74 84 91 96 100 108 124 126 127 133 134 144 145 148 158 #> [39] 159 160 161 162 166 169 180 185 186 193 198 199 203 204 205 208 214 215 226 #> [58] 231 235 #> #> $SubSet3 #> [1] 1 2 13 15 26 27 36 42 48 50 51 52 61 64 67 72 76 77 78 #> [20] 86 92 98 102 107 110 115 117 118 120 121 130 136 138 140 141 142 147 156 #> [39] 167 171 173 176 184 189 194 196 197 206 209 211 212 217 218 219 221 222 227 #> [58] 230 233 #> #> $SubSet4 #> [1] 4 7 8 12 17 20 28 29 32 33 35 43 45 75 79 82 83 87 88 #> [20] 89 93 99 109 112 114 116 122 128 129 131 132 135 137 146 149 150 152 153 #> [39] 154 157 163 165 170 172 175 179 181 182 183 187 192 195 201 207 213 220 223 #> [58] 225 236 head(batch_names(index)) #> [1] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet4\" \"SubSet2\" \"SubSet2\" # Or via inspect() to keep it in a matrix format: head(inspect(index, survey[, keep])) #> Sex W.Hnd Smoke Age batch #> 1 Female Right Never 18.250 SubSet3 #> 2 Male Left Regul 17.583 SubSet3 #> 3 Male Right Occas 16.917 SubSet1 #> 4 Male Right Never 20.333 SubSet4 #> 5 Male Right Never 23.667 SubSet2 #> 6 Female Right Never 21.000 SubSet2"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"previous-work","dir":"","previous_headings":"","what":"Previous work","title":"Design experiments for batches","text":"CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"other","dir":"","previous_headings":"","what":"Other","title":"Design experiments for batches","text":"Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Name the batch — batch_names","title":"Name the batch — batch_names","text":"Given index return name batches samples ","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Name the batch — batch_names","text":"","code":"batch_names(i)"},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Name the batch — batch_names","text":"list numeric indices.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Name the batch — batch_names","text":"character vector names batch index.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Name the batch — batch_names","text":"","code":"index <- create_subset(100, 50, 2) batch <- batch_names(index) head(batch) #> [1] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check experiment data — check_data","title":"Check experiment data — check_data","text":"order run successful experiment good design needed even measuring data. functions checks several heuristics good experiment warns found.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check experiment data — check_data","text":"","code":"check_data(pheno, omit = NULL, na.omit = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check experiment data — check_data","text":"pheno Data.frame variables sample, one row one sample. omit Character vector names columns omit. na.omit Check effects missing values .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check experiment data — check_data","text":"logical value indicating everything alright (TRUE) (FALSE).","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check experiment data — check_data","text":"","code":"rdata <- expand.grid(sex = c(\"M\", \"F\"), class = c(\"lower\", \"median\", \"high\")) rdata2 <- rbind(rdata, rdata) check_data(rdata2) #> [1] TRUE # \\donttest{ #Different warnings check_data(rdata) #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE check_data(rdata[-c(1, 3), ]) #> Warning: Two categorical variables don't have all combinations. #> Warning: There is a category with just one sample. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE data(survey, package = \"MASS\") check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE # }"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Check index distribution on batches — check_index","title":"Check index distribution on batches — check_index","text":"Report statistics subset variable compared original.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check index distribution on batches — check_index","text":"","code":"check_index(pheno, index, omit = NULL)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check index distribution on batches — check_index","text":"pheno Data.frame sample information. index list indices indicating samples go subset. omit Name columns pheno omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check index distribution on batches — check_index","text":"matrix differences original data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check index distribution on batches — check_index","text":"closer values 0, less difference original distribution, better randomization.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check index distribution on batches — check_index","text":"","code":"index <- create_subset(50, 24) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) check_index(metadata, index) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.70337556 0.64335530 0.25552717 #> weight 1.78087320 23.64064592 4.85755683 #> sex 0.08412415 0.08412415 0.07659676"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Compares two indexes — compare_index","title":"Compares two indexes — compare_index","text":"Compare distribution samples two different batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compares two indexes — compare_index","text":"","code":"compare_index(pheno, index1, index2)"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compares two indexes — compare_index","text":"pheno data.frame samples characteristics normalize. index1, index2 list index sample, name column pheno batch subset character .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compares two indexes — compare_index","text":"matrix variables columns batch. Negative values indicate index1 better.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compares two indexes — compare_index","text":"","code":"index1 <- create_subset(50, 24) index2 <- batch_names(create_subset(50, 24)) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) compare_index(metadata, index1, index2) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.27800502 0.55676788 0.16930483 #> weight 1.27977491 -18.94390957 3.73226093 #> sex -0.03162073 -0.01803725 -0.02785387"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Create index of subsets of a data — create_subset","title":"Create index of subsets of a data — create_subset","text":"Index samples grouped batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create index of subsets of a data — create_subset","text":"","code":"create_subset(size_data, size_subset = NULL, n = NULL, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create index of subsets of a data — create_subset","text":"size_data numeric value amount samples distribute. size_subset numeric value amount samples per batch. n numeric value number batches. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create index of subsets of a data — create_subset","text":"random list indices samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create index of subsets of a data — create_subset","text":"","code":"index <- create_subset(100, 50, 2)"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment — design","title":"Design a batch experiment — design","text":"Given samples distribute several batches, trying equal number samples per batch. can handle numeric categorical data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment — design","text":"","code":"design(pheno, size_subset, omit = NULL, iterations = 500, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment — design","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment — design","text":"indices samples go batch.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment — design","text":"","code":"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] 16 19 23 27 28 35 37 42 54 64 74 86 90 91 92 94 96 100 106 #> [20] 116 119 120 122 124 127 128 136 137 139 154 156 159 178 181 202 204 205 207 #> [39] 208 209 212 218 219 222 223 226 229 237 #> #> $SubSet2 #> [1] 11 13 24 26 34 45 47 58 59 69 75 83 84 88 89 97 103 109 110 #> [20] 118 129 130 142 145 146 149 152 153 160 162 166 171 175 179 184 187 191 193 #> [39] 194 197 199 200 210 220 228 231 234 235 #> #> $SubSet3 #> [1] 1 9 12 14 15 17 20 21 29 30 31 38 43 44 46 48 52 53 55 #> [20] 60 67 76 79 80 82 95 98 107 112 133 138 144 147 150 151 157 169 174 #> [39] 176 188 190 198 206 216 221 227 236 #> #> $SubSet4 #> [1] 2 8 10 18 22 25 32 33 36 39 40 41 49 51 56 61 62 63 68 #> [20] 72 73 93 99 101 104 108 113 126 131 132 134 140 141 143 148 163 164 165 #> [39] 167 180 182 186 189 201 203 224 232 #> #> $SubSet5 #> [1] 3 4 5 6 7 50 57 65 66 70 71 77 78 81 85 87 102 105 111 #> [20] 114 115 117 121 123 125 135 155 158 161 168 170 172 173 177 183 185 192 195 #> [39] 196 211 213 214 215 217 225 230 233 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribution by batch — distribution","title":"Distribution by batch — distribution","text":"Checks values maximally distributed several batches. Aimed categorical variables.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribution by batch — distribution","text":"","code":"distribution(report, column)"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribution by batch — distribution","text":"report data.frame must contain batch column. can obtained inspect(). column name column one wants inspect.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribution by batch — distribution","text":"TRUE values maximal distributed, otherwise FALSE.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribution by batch — distribution","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") nas <- c(137, 70) # Omit rows with NA to avoid warnings in design index <- design(pheno = survey[-nas, columns], size_subset = 70, iterations = 10) batches <- inspect(index, survey[-nas, columns]) distribution(batches, \"Sex\") #> [1] TRUE distribution(batches, \"Smoke\") #> [1] TRUE"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the entropy — entropy","title":"Calculates the entropy — entropy","text":"Calculates entropy category. uses amount categories scale 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the entropy — entropy","text":"","code":"entropy(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the entropy — entropy","text":"x character vector two categories","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the entropy — entropy","text":"numeric value Shannon entropy scaled 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculates the entropy — entropy","text":"omits NA present.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculates the entropy — entropy","text":"","code":"entropy(c(\"H\", \"T\", \"H\", \"T\")) #> [1] 1 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", \"H\")) #> [1] 0.8631206 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", NA)) #> [1] 0.9182958 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\")) #> [1] 0.9182958 entropy(c(\"H\", \"H\", \"H\", \"H\", \"H\", \"H\", NA)) #> [1] 0"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate entropy — evaluate_entropy","title":"Evaluate entropy — evaluate_entropy","text":"Looks nominal character columns equally distributed according entropy taking account independence batches. column different row assumed sample names thus omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate entropy — evaluate_entropy","text":"","code":"evaluate_entropy(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate entropy — evaluate_entropy","text":"list numeric indices data.frame pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate entropy — evaluate_entropy","text":"Value minimize","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate entropy — evaluate_entropy","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_entropy(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.007264842 0.481002114"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare independence by chisq.test — evaluate_independence","title":"Compare independence by chisq.test — evaluate_independence","text":"Looks independence categories batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"evaluate_independence(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare independence by chisq.test — evaluate_independence","text":"Index subsets. pheno data.frame information samples.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare independence by chisq.test — evaluate_independence","text":"Returns vector p-values chisq.test category subset.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_independence(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.09211905 0.50037711"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates a data.frame — evaluate_index","title":"Evaluates a data.frame — evaluate_index","text":"Measures several indicators per group","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates a data.frame — evaluate_index","text":"","code":"evaluate_index(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates a data.frame — evaluate_index","text":"Index pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates a data.frame — evaluate_index","text":"array three dimensions mean, standard deviation (sd()), median absolute deviation (mad()) numeric variables, entropy categorical number NA subgroup.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates a data.frame — evaluate_index","text":"","code":"data(survey, package = \"MASS\") index <- create_subset(nrow(survey), 50, 5) ev_index <- evaluate_index(index, survey[, c(\"Sex\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). ev_index[\"entropy\", , ] #> subgroups #> variables SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> Sex 0.9949848 0.9544340 1.0000000 0.9970591 0.9918208 #> Smoke 0.4001934 0.4855790 0.4487245 0.6082579 0.5376809 #> mix_cat 0.6660806 0.6605638 0.6587911 0.7305701 0.7266037"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate median absolute deviation — evaluate_mad","title":"Evaluate median absolute deviation — evaluate_mad","text":"Looks median absolute deviation values subgroup.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"evaluate_mad(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate median absolute deviation — evaluate_mad","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate median absolute deviation — evaluate_mad","text":"vector mean difference median absolute deviation group original mad.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mad(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 25.90814"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_mean","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"Looks mean numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"evaluate_mean(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"matrix mean value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mean(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 0.2733898"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate the dispersion of NAs — evaluate_na","title":"Evaluate the dispersion of NAs — evaluate_na","text":"Looks NA distributed subset","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"evaluate_na(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate the dispersion of NAs — evaluate_na","text":"list numeric indices data.frame pheno Data.frame","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate the dispersion of NAs — evaluate_na","text":"optimum value reduce","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"samples <- 10 m <- matrix(rnorm(samples), nrow = samples) m[sample(seq_len(samples), size = 5), ] <- NA # Some NA i <- create_subset(samples, 3, 4) # random subsets evaluate_na(i, m) #> [1] 0.375"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate each variable provided — evaluate_orig","title":"Evaluate each variable provided — evaluate_orig","text":"Measure summary statistics whole cohort samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"evaluate_orig(pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate each variable provided — evaluate_orig","text":"pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate each variable provided — evaluate_orig","text":"matrix mean, standard deviation, MAD values numeric variables, entropy categorical, amount NA per variable.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"data(survey, package = \"MASS\") evaluate_orig(survey[, c(\"Sex\", \"Age\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). #> Sex Age Smoke mix_cat #> mean 0 20.374515 0.0000000 0.0000000 #> sd 0 6.474335 0.0000000 0.0000000 #> mad 0 1.605656 0.0000000 0.0000000 #> na 1 0.000000 1.0000000 0.0000000 #> entropy 1 0.000000 0.5143828 0.6268135 #> independence 0 0.000000 0.0000000 0.0000000"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_sd","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"Looks standard deviation numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"evaluate_sd(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"List indices pheno Data.frame samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"matrix standard deviation value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_sd(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 1.647705"},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":null,"dir":"Reference","previous_headings":"","what":"experDesign: Expert experiment design in batches — experDesign-package","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Enables easy distribution samples per batch avoiding batch confounding effects randomization variables batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"important function design(), distributes samples batches according information provided. help bench inspect() function appends group data provided. grid spatial data, might want look spatial() function distribute samples keeping original design. case experiment half processed need extend can use follow_up() follow_up2(). helps selecting samples already used used follow .","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Lluís Revilla","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Select the subset of extreme cases to evaluation — extreme_cases","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"Subset samples mostly different.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"extreme_cases(pheno, size, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"pheno Data.frame sample information. size number samples subset. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"vector number rows selected.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) sel <- extreme_cases(metadata, 10) # We can see that it selected both Female and Males and wide range of height # and weight: metadata[sel, ] #> height weight sex #> 1 60 100 Male #> 4 75 100 Male #> 5 80 100 Male #> 13 70 200 Male #> 14 75 200 Male #> 21 60 300 Male #> 25 80 300 Male #> 29 75 100 Female #> 47 65 300 Female #> 48 70 300 Female"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments — follow_up","title":"Follow up experiments — follow_up","text":"experiment carried samples want continue samples later .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments — follow_up","text":"","code":"follow_up( original, follow_up, size_subset, omit = NULL, old_new = \"batch\", iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments — follow_up","text":"original data.frame information samples used originally. follow_up data.frame information new samples. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. old_new Name column batch status stored. matches name column original used find previous batches. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments — follow_up","text":"data.frame common columns data, new column old_new, batch column filled new batches needed.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments — follow_up","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] fu <- follow_up(survey1, survey2, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> Warning: Column batch is already present. Did you meant this?"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments in batches — follow_up2","title":"Follow up experiments in batches — follow_up2","text":"Design experiment data new old together.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments in batches — follow_up2","text":"","code":"follow_up2(all_data, batch_column = \"batch\", ...)"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments in batches — follow_up2","text":"all_data data.frame data samples. row sample. batch_column name column all_data batches used. NA interpreted new data, empty considered batch. ... Arguments passed design size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments in batches — follow_up2","text":"data.frame batch_column filled new batches needed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Follow up experiments in batches — follow_up2","text":"batch_column empty samples considered new. size_subset missing, estimated previous batch Similarly, iterations name guessed inferred samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments in batches — follow_up2","text":"","code":"data(survey, package = \"MASS\") # Create the first batch first_batch_n <- 118 variables <- c(\"Sex\", \"Smoke\", \"Age\") survey1 <- survey[seq_len(first_batch_n), variables] index1 <- design(survey1, size_subset = 50, iterations = 10) #> Warning: There might be some problems with the data use check_data(). r_survey <- inspect(index1, survey1) # Create the second batch with \"new\" students survey2 <- survey[seq(from = first_batch_n +1, to = nrow(survey)), variables] survey2$batch <- NA # Prepare the follow up all_classroom <- rbind(r_survey, survey2) follow_up2(all_classroom, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet1\" #> [6] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [11] \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet1\" #> [16] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [21] \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [26] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [31] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [36] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet3\" #> [41] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [46] \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [51] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet2\" #> [56] \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [61] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [66] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" #> [71] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [76] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet2\" #> [81] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [86] \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [91] \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet2\" #> [96] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [101] \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" #> [106] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [111] \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [116] \"SubSet3\" \"SubSet1\" \"SubSet3\" \"NewSubset1\" \"NewSubset3\" #> [121] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" #> [126] \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [131] \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [136] \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" #> [141] \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [146] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset2\" #> [151] \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" #> [156] \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [161] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [166] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" #> [171] \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset2\" #> [176] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [181] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [186] \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [191] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" #> [196] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" #> [201] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [206] \"NewSubset3\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [211] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" #> [216] \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" #> [221] \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [226] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [231] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [236] \"NewSubset2\" \"NewSubset1\""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":null,"dir":"Reference","previous_headings":"","what":"Inspect the index — inspect","title":"Inspect the index — inspect","text":"Given index data samples append batch assignment","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inspect the index — inspect","text":"","code":"inspect(i, pheno, omit = NULL, index_name = \"batch\")"},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inspect the index — inspect","text":"List indices samples per batch pheno Data.frame sample information. omit Name columns pheno omitted. index_name Column name index resulting data.frame.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inspect the index — inspect","text":"data.frame new column batch name batch sample goes .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inspect the index — inspect","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") index <- design(pheno = survey[, columns], size_subset = 70, iterations = 10) #> Warning: There might be some problems with the data use check_data(). batches <- inspect(index, survey[, columns]) head(batches) #> Sex Age Smoke batch #> 1 Female 18.250 Never SubSet3 #> 2 Male 17.583 Regul SubSet4 #> 3 Male 16.917 Occas SubSet3 #> 4 Male 20.333 Never SubSet4 #> 5 Male 23.667 Never SubSet3 #> 6 Female 21.000 Never SubSet4"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":null,"dir":"Reference","previous_headings":"","what":"Optimum values for batches — optimum","title":"Optimum values for batches — optimum","text":"Calculates optimum values number batches size batches. need several batches can better distribute evenly add replicates.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optimum values for batches — optimum","text":"","code":"optimum_batches(size_data, size_subset) optimum_subset(size_data, batches) sizes_batches(size_data, size_subset, batches)"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optimum values for batches — optimum","text":"size_data numeric value number samples use. size_subset Numeric value number sample per batch. batches numeric value number batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optimum values for batches — optimum","text":"optimum_batches numeric value number batches use. optimum_subset numeric value maximum number samples per batch data. sizes_batches numeric vector number samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Optimum values for batches — optimum","text":"","code":"size_data <- 50 size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) #> [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) #> [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) #> [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":null,"dir":"Reference","previous_headings":"","what":"Random subset — qcSubset","title":"Random subset — qcSubset","text":"Select randomly samples index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random subset — qcSubset","text":"","code":"qcSubset(index, size, each = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random subset — qcSubset","text":"index list indices indicating samples go subset. size number samples taken. logical value subset taken samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random subset — qcSubset","text":"","code":"set.seed(50) index <- create_subset(100, 50, 2) QC_samples <- qcSubset(index, 10) QC_samplesBatch <- qcSubset(index, 10, TRUE)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment with experimental controls — replicates","title":"Design a batch experiment with experimental controls — replicates","text":"ensure batches comparable samples processed batch. function allows take account effect. uses different samples controls defined extreme_cases().","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"replicates(pheno, size_subset, controls, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment with experimental controls — replicates","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. controls numeric value amount technical controls per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment with experimental controls — replicates","text":"index samples duplicated batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Design a batch experiment with experimental controls — replicates","text":"control variance replicates important, see example https://www.nature.com/articles/nmeth.3091.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"samples <- data.frame(L = letters[1:25], Age = rnorm(25), type = sample(LETTERS[1:5], 25, TRUE)) index <- replicates(samples, 5, controls = 2, omit = \"L\", iterations = 10) head(index) #> $SubSet1 #> [1] 1 7 12 19 21 #> #> $SubSet2 #> [1] 2 4 17 19 21 #> #> $SubSet3 #> [1] 6 18 19 21 25 #> #> $SubSet4 #> [1] 5 19 21 22 23 #> #> $SubSet5 #> [1] 3 8 11 19 21 #> #> $SubSet6 #> [1] 10 19 21 24 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribute the sample on the plate — spatial","title":"Distribute the sample on the plate — spatial","text":"function assumes process batch samples distributed plate grid scheme.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribute the sample on the plate — spatial","text":"","code":"spatial( index, pheno, omit = NULL, remove_positions = NULL, rows = LETTERS[1:5], columns = 1:10, iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribute the sample on the plate — spatial","text":"index list samples subgroup, provided design() replicates(). pheno Data.frame sample information. omit Name columns pheno omitted. remove_positions Character, name positions avoided grid. rows Character, name rows used. columns Character, name rows used. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribute the sample on the plate — spatial","text":"indices samples go batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribute the sample on the plate — spatial","text":"","code":"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(). index2 <- spatial(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")], iterations = 10) head(index2) #> $A1 #> [1] 86 131 52 76 1 #> #> $B1 #> [1] 27 130 124 133 175 #> #> $C1 #> [1] 74 21 110 161 99 #> #> $D1 #> [1] 162 48 158 108 233 #> #> $E1 #> [1] 141 234 222 166 127 #> #> $A2 #> [1] 100 49 227 29 125 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a factor to index — use_index","title":"Convert a factor to index — use_index","text":"Convert given factor accepted index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a factor to index — use_index","text":"","code":"use_index(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a factor to index — use_index","text":"x character factor used index","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert a factor to index — use_index","text":"","code":"plates <- c(\"P1\", \"P2\", \"P1\", \"P2\", \"P2\", \"P3\", \"P1\", \"P3\", \"P1\", \"P1\") use_index(plates) #> $P1 #> [1] 1 3 7 9 10 #> #> $P2 #> [1] 2 4 5 #> #> $P3 #> [1] 6 8 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":null,"dir":"Reference","previous_headings":"","what":"Check the data for a follow up experiment. — valid_followup","title":"Check the data for a follow up experiment. — valid_followup","text":"Sometimes samples collected analyzed, later another batch samples analyzed. function tries detect problems data data combined single analysis. know specific problems data need use check_data()","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"valid_followup( old_data = NULL, new_data = NULL, all_data = NULL, omit = NULL, column = \"batch\" )"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check the data for a follow up experiment. — valid_followup","text":"old_data, new_data data.frame old new data respectively. all_data data.frame data samples. row sample. omit Name columns pheno omitted. column name column old data batch information, whether data new (NA) case all_data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check the data for a follow up experiment. — valid_followup","text":"Called side effects warnings, returns logical value issues (FALSE) (TRUE)","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] valid_followup(survey1, survey2) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE survey$batch <- NA survey$batch[1:118] <- \"old\" valid_followup(all_data = survey) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-development-version","dir":"Changelog","previous_headings":"","what":"experDesign (development version)","title":"experDesign (development version)","text":"Check index used inspect valid length, positions replications matching data provided. check_data() gains new omit argument (#49). relied positional arguments break scripts. Omitting non existing columns now creates warning.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-030","dir":"Changelog","previous_headings":"","what":"experDesign 0.3.0","title":"experDesign 0.3.0","text":"CRAN release: 2024-02-20 Fixed bug spatial() multiple samples assigned position plate (#45). Added warning batch_names() index repeated positions (revealed #45).","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-020","dir":"Changelog","previous_headings":"","what":"experDesign 0.2.0","title":"experDesign 0.2.0","text":"CRAN release: 2023-04-05 New follow_up() follow_up2() continue experiment safely (#22). New check_data() check input data (#37). New compare_index() compare different indexes per batch. Use categories combined (column mix_cat) comparing batches. Increased internal coherence checks. Added thesis advisers description. Update documentation.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-010","dir":"Changelog","previous_headings":"","what":"experDesign 0.1.0","title":"experDesign 0.1.0","text":"CRAN release: 2021-04-22 Added reference new package Omixer README. Fixed batches sizes errors. Speed increase (5x) design, spatial replicates. Update Code Conduct. Add online documentation url.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-004","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.4","title":"experDesign 0.0.4","text":"CRAN release: 2020-09-28 Remove BiocStyle dependency. Gain ability name subsets. Add examples functions. Add function consider spatial distribution plates/machines.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-002","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.2","title":"experDesign 0.0.2","text":"CRAN release: 2020-09-08 CRAN release","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-0009000","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.0.9000","title":"experDesign 0.0.0.9000","text":"Added NEWS.md file track changes package.","code":""}] +[{"path":[]},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement package’s maintainer email. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://experdesign.llrs.dev/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"https://experdesign.llrs.dev/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2018 Lluís Revilla Sancho Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"exprDesign","text":"package developed help prepare samples send facility. assumes collected samples information still need experiment several batches due technical practical limitations. question tries answer : samples go batch? possible combinations samples, looks combination minimizes differences subgroup according following rules: variable categorical tires randomize variable across subgroups. variable numeric tries distribute evenly following original distribution values. NA (available values) looks distribute randomly. Even measures might end batch effect due : - Confounding variables provided randomization batches Sometimes due unknown, impossible measure. - Lack replicates(samples conditions) can’t provide new replicates, aim provide technical replicates. Technical replicates mean reanalyzing sample twice , samples technical replicates accurate measures easier avoid detect batch effects. - Processing change methodology, pause resume later sample collection might changes outcome due external factors.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"previous-work","dir":"Articles","previous_headings":"","what":"Previous work","title":"exprDesign","text":"building package like give credit made also efforts direction: CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"DoE","dir":"Articles","previous_headings":"","what":"Design of Experiment","title":"exprDesign","text":"Imagine samples already collected want distributed batches: First can check data see concerns regarding categories: none confounding variables artificial dataset (see examples, ’ll find ). However, block incorrectly end group single batch end batch effect. order avoid design() helps assign sample batch (case batch 24 samples ). First can explore number samples number batches: Note instead using whole batch leave single sample third distributes samples three batches needed.","code":"library(\"experDesign\") metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) head(metadata, 15) ## height weight sex ## 1 60 100 Male ## 2 65 100 Male ## 3 70 100 Male ## 4 75 100 Male ## 5 80 100 Male ## 6 60 150 Male ## 7 65 150 Male ## 8 70 150 Male ## 9 75 150 Male ## 10 80 150 Male ## 11 60 200 Male ## 12 65 200 Male ## 13 70 200 Male ## 14 75 200 Male ## 15 80 200 Male check_data(metadata) ## [1] TRUE size_data <- nrow(metadata) size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) ## [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) ## [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) ## [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization","dir":"Articles","previous_headings":"","what":"Randomization","title":"exprDesign","text":"can directly look distribution samples given max number samples per batch: Naively one either fill batches fully distribute evenly (first 17 packages together, next 17 ). solution ensures data randomized. random distribution can increase number iterations performed calculate distribution.","code":"desi <- design(metadata, size_batch) # It is a list but we can convert it to a vector with: batch_names(desi) ## [1] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" ## [8] \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" ## [15] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" ## [22] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" ## [29] \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" ## [36] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet2\" ## [43] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet1\" ## [50] \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"randomization-and-replicates","dir":"Articles","previous_headings":"","what":"Randomization and replicates","title":"exprDesign","text":"need space replicates control batch effect can use: seeks controls diverse values adds samples distribution. Note sample already present batch added , ’s number samples per batch different design without replicates.","code":"repli <- replicates(metadata, size_batch, 5) lengths(repli) ## SubSet1 SubSet2 SubSet3 ## 21 21 18 repli ## $SubSet1 ## [1] 3 9 10 16 17 20 27 28 30 31 32 33 34 35 40 41 42 44 45 48 49 ## ## $SubSet2 ## [1] 4 5 7 8 9 10 13 15 18 21 22 25 26 32 33 34 36 37 38 39 47 ## ## $SubSet3 ## [1] 1 2 6 9 10 11 12 14 19 23 24 29 32 33 34 43 46 50"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"layout","dir":"Articles","previous_headings":"","what":"Layout","title":"exprDesign","text":"can analyze samples distributed layout 6x4:","code":"spati <- spatial(repli, metadata, rows = LETTERS[1:6], columns = 1:4) head(spati) ## $A1 ## SubSet1 SubSet2 SubSet3 ## 32 43 56 ## ## $B1 ## SubSet1 SubSet2 SubSet3 ## 3 37 27 ## ## $C1 ## SubSet1 SubSet2 SubSet3 ## 34 29 28 ## ## $D1 ## SubSet1 SubSet2 SubSet3 ## 36 5 60 ## ## $E1 ## SubSet1 SubSet2 SubSet3 ## 52 13 33 ## ## $F1 ## SubSet1 SubSet2 SubSet3 ## 39 7 53"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"report-for-easy-on-field-usage","dir":"Articles","previous_headings":"","what":"Report for easy on field usage","title":"exprDesign","text":"can add batches initial data inspect(): now can see batch position sample","code":"report <- inspect(repli, metadata) report2 <- inspect(spati, report, index_name = \"position\") head(report2) ## height weight sex batch position ## 1 60 100 Male SubSet3 E2 ## 2 65 100 Male SubSet3 D2 ## 3 70 100 Male SubSet1 B1 ## 4 75 100 Male SubSet2 E3 ## 5 80 100 Male SubSet2 D1 ## 6 60 150 Male SubSet3 B2"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"compare-indices","dir":"Articles","previous_headings":"","what":"Compare indices","title":"exprDesign","text":"two indices can also compare : many variables multiple subsets negative shows desi better.","code":"desi2 <- create_subset(nrow(metadata), size_batch) compare_index(metadata, desi, desi2) ## subgroups ## SubSet1 SubSet2 SubSet3 ## height 0.21717472 0.30918015 -0.008630805 ## weight -3.20170175 -3.83581391 -11.626327348 ## sex -0.00669491 0.00669491 -0.011421802"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"unbalanced-setting","dir":"Articles","previous_headings":"","what":"Unbalanced setting","title":"exprDesign","text":"previous case data mostly balanced (check orig object) let’s create unbalanced dataset check . dataset one female, resulting classroom full males. Age independent sex classroom. can see simple case single variable cases approximately reached entropy levels.","code":"n <- 99 samples <- 100 unbalanced <- data.frame(Classroom = rep(c(\"A\", \"B\"), each = samples/2), Sex = c(rep(\"M\", n), rep(\"F\", samples-n)), Age = rnorm(samples, mean = 25, sd = 3)) table(unbalanced[, 1:2]) ## Sex ## Classroom F M ## A 0 50 ## B 1 49 i <- design(unbalanced, 15) ## Warning: There might be some problems with the data use check_data(). evaluation <- evaluate_index(i, unbalanced) ## Warning: There might be some problems with the data use check_data(). # Mean entropy en each subset rowMeans(evaluation[\"entropy\", , ]) ## Classroom Sex Age mix_cat ## 0.96035770 0.05303319 0.00000000 0.93994182 # Original entropy on the dataset evaluate_orig(unbalanced)[\"entropy\", ] ## Warning in evaluate_orig(unbalanced): There might be some problems with the ## data use check_data(). ## Classroom Sex Age mix_cat ## 1.00000000 0.08079314 0.00000000 0.67554928 # Dispersion of the entropy apply(evaluation[\"entropy\", , ], 1, sd) ## Classroom Sex Age mix_cat ## 0.05017590 0.14031263 0.00000000 0.07994645"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"quality-check","dir":"Articles","previous_headings":"","what":"Quality check","title":"exprDesign","text":"need subset samples diverse can use following function: can also test given index check_index(): row information accurate given variable samples available (case unbalanced). variables distributed randomly others index. satisfied design() new index increasing iterations obtain potentially better distribution. want good stratified randomization increase iterations used 10 fold.","code":"data(survey, package = \"MASS\") head(survey) ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric ## 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial ## 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA ## 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric ## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric ## 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial ## Age ## 1 18.250 ## 2 17.583 ## 3 16.917 ## 4 20.333 ## 5 23.667 ## 6 21.000 samples <- extreme_cases(survey, size = 10) survey[samples, ] ## Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I ## 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric ## 9 Male 20.0 19.5 Right R on L 72 Right Some Never 175.00 Metric ## 84 Female 17.0 17.4 Right R on L NA Neither Some Never NA ## 99 Male 19.5 19.4 Right Neither NA Right Freq Never 165.00 Metric ## 107 Female 16.2 16.4 Right R on L NA Right Freq Occas 172.00 Metric ## 171 Female 16.5 17.0 Right L on R NA Right Some Never 168.00 Metric ## 177 Male 20.5 20.5 Right Neither 76 Right Freq Regul 172.72 Imperial ## 191 Male 20.0 19.5 Right R on L 92 Right Some Never 179.10 Imperial ## 201 Female 16.2 15.8 Right R on L 61 Right Some Occas 167.00 Metric ## 202 Male 21.0 21.0 Right L on R 48 Neither Freq Never 174.00 Metric ## Age ## 5 23.667 ## 9 19.000 ## 84 17.167 ## 99 18.083 ## 107 17.000 ## 171 73.000 ## 177 36.583 ## 191 18.917 ## 201 19.250 ## 202 21.333 check_index(unbalanced, i) ## Warning in check_index(unbalanced, i): There might be some problems with the ## data use check_data(). ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 SubSet6 ## Classroom 0.02116629 0.02116629 0.04000152 0.04000152 0.06572331 0.02009684 ## Sex 0.17853702 0.17853702 0.24841904 0.17853702 0.17853702 0.17853702 ## Age 0.20351157 0.19733814 0.25375813 0.28706685 0.12655149 0.14621487 ## mix_cat 0.08031059 0.08031059 0.03045638 0.06618417 0.04689282 0.08111268 ## subgroups ## SubSet7 ## Classroom 0.02502079 ## Sex 0.17853702 ## Age 0.45676502 ## mix_cat 0.07741971"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"internals","dir":"Articles","previous_headings":"","what":"Internals","title":"exprDesign","text":"check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can measure index : values come calculating difference original data samples subset median, mean, mad, NA, entropy independence (chisq.test() p.value). values meaning, internally used compare possible index: compares previous index score lower previous one new index kept. done similarly spatial search, adds two new categorical variables position samples calculating statistics.","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) ## [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) ## Sex W.Hnd Smoke Age ## 1 Female Right Never 18.250 ## 2 Male Left Regul 17.583 ## 3 Male Right Occas 16.917 ## 4 Male Right Never 20.333 ## 5 Male Right Never 23.667 ## 6 Female Right Never 21.000 # Set a seed for reproducibility # Looking for groups at most of 70 samples. index <- create_subset(nrow(survey), size_subset = 70) index ## $SubSet1 ## [1] 9 12 21 25 34 37 43 47 58 59 65 67 68 73 74 77 79 80 103 ## [20] 104 113 120 136 140 142 143 144 148 152 153 162 164 165 170 172 173 174 176 ## [39] 178 181 182 185 189 190 192 194 197 202 203 205 208 214 215 217 219 221 224 ## [58] 231 235 237 ## ## $SubSet2 ## [1] 1 2 7 8 22 23 29 30 33 36 39 42 45 46 51 54 55 64 71 ## [20] 75 76 91 102 105 109 111 114 115 117 118 119 123 125 128 132 135 138 154 ## [39] 155 159 167 177 187 191 193 195 196 198 200 201 207 211 212 218 222 227 228 ## [58] 230 233 ## ## $SubSet3 ## [1] 3 4 11 13 14 15 18 19 20 24 28 31 32 35 41 48 49 50 52 ## [20] 70 72 81 84 85 86 87 92 93 94 98 112 121 122 124 126 127 129 130 ## [39] 134 137 139 141 147 151 157 158 161 168 171 179 183 199 204 210 213 220 223 ## [58] 225 234 ## ## $SubSet4 ## [1] 5 6 10 16 17 26 27 38 40 44 53 56 57 60 61 62 63 66 69 ## [20] 78 82 83 88 89 90 95 96 97 99 100 101 106 107 108 110 116 131 133 ## [39] 145 146 149 150 156 160 163 166 169 175 180 184 186 188 206 209 216 226 229 ## [58] 232 236 score_index1 <- check_index(survey[, keep], index) ## Warning in check_index(survey[, keep], index): There might be some problems ## with the data use check_data(). score_index1 ## subgroups ## SubSet1 SubSet2 SubSet3 SubSet4 ## Sex 0.285472670 0.28479310 0.45087536 0.28479310 ## W.Hnd 0.406863574 0.56967175 0.38262251 0.38311366 ## Smoke 0.352226528 0.35423141 0.51717322 0.36004142 ## Age 0.966161840 0.88451852 0.78376910 1.52773530 ## mix_cat 0.009637159 0.02713277 0.02836273 0.00787233 index2 <- create_subset(nrow(survey), size_subset = 70) score_index2 <- check_index(survey[, keep], index2) ## Warning in check_index(survey[, keep], index2): There might be some problems ## with the data use check_data(). sum(rowMeans(abs(score_index2-score_index1))) ## [1] 0.8869192"},{"path":"https://experdesign.llrs.dev/dev/articles/experdesign.html","id":"sessioninfo","dir":"Articles","previous_headings":"","what":"SessionInfo","title":"exprDesign","text":"","code":"sessionInfo() ## R version 4.4.0 (2024-04-24) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 ## [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 ## [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C ## [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] experDesign_0.3.0.9002 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.46 rlang_1.1.3 ## [5] xfun_0.43 purrr_1.0.2 textshaping_0.3.7 jsonlite_1.8.8 ## [9] htmltools_0.5.8.1 ragg_1.3.1 sass_0.4.9 rmarkdown_2.26 ## [13] evaluate_0.23 jquerylib_0.1.4 fastmap_1.1.1 yaml_2.3.8 ## [17] lifecycle_1.0.4 memoise_2.0.1 compiler_4.4.0 fs_1.6.4 ## [21] systemfonts_1.0.6 digest_0.6.35 R6_2.5.1 magrittr_2.0.3 ## [25] bslib_0.7.0 tools_4.4.0 pkgdown_2.0.9 cachem_1.0.8 ## [29] desc_1.4.3"},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Lluís Revilla Sancho. Author, maintainer. Juanjo Lozano. Thesis advisor. Azucena Salas Martinez. Thesis advisor.","code":""},{"path":"https://experdesign.llrs.dev/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Revilla Sancho L (????). experDesign: Design Experiments Batches. R package version 0.3.0.9002, https://github.com/llrs/experDesign/, https://experdesign.llrs.dev. Revilla Sancho L, Lozano J, Salas Martinez (2021). “experDesign: stratifying samples batches minimal bias.” Journal Open Source Software, 6(67), 6. doi:10.21105/joss.03358, https://joss.theoj.org/papers/10.21105/joss.03358.","code":"@Manual{, title = {experDesign: Design Experiments for Batches}, author = {Lluís {Revilla Sancho}}, note = {R package version 0.3.0.9002, https://github.com/llrs/experDesign/}, url = {https://experdesign.llrs.dev}, } @Article{, title = {experDesign: stratifying samples into batches with minimal bias}, doi = {10.21105/joss.03358}, author = {Lluís {Revilla Sancho} and Juanjo Lozano and Azucena {Salas Martinez}}, journal = {Journal of Open Source Software}, year = {2021}, volume = {6}, number = {67}, pages = {6}, url = {https://joss.theoj.org/papers/10.21105/joss.03358}, }"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"experdesign","dir":"","previous_headings":"","what":"Design experiments for batches","title":"Design experiments for batches","text":"goal experDesign help manage samples experiment collected. example, checking common problems data, help reduce even prevent batch bias performing experiment, measure already done provides four main functions: check_data(): Check problems data. design(): Randomize samples according variables. replicates(): Selects samples replicates randomizes samples (highly recommended). spatial(): Randomize samples spatial grid.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Design experiments for batches","text":"install latest version CRAN use: can install development version pkgdown GitHub :","code":"install.packages(\"experDesign\") # install.packages(\"devtools\") devtools::install_github(\"llrs/experDesign\")"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"Design experiments for batches","text":"can use survey dataset examples: dataset numeric, categorical values NA values.","code":"library(\"experDesign\") data(survey, package = \"MASS\") head(survey) #> Sex Wr.Hnd NW.Hnd W.Hnd Fold Pulse Clap Exer Smoke Height M.I #> 1 Female 18.5 18.0 Right R on L 92 Left Some Never 173.00 Metric #> 2 Male 19.5 20.5 Left R on L 104 Left None Regul 177.80 Imperial #> 3 Male 18.0 13.3 Right L on R 87 Neither None Occas NA #> 4 Male 18.8 18.9 Right R on L NA Neither None Never 160.00 Metric #> 5 Male 20.0 20.0 Right Neither 35 Right Some Never 165.00 Metric #> 6 Female 18.0 17.7 Right L on R 64 Right Some Never 172.72 Imperial #> Age #> 1 18.250 #> 2 17.583 #> 3 16.917 #> 4 20.333 #> 5 23.667 #> 6 21.000"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"checking-initial-data","dir":"","previous_headings":"Example","what":"Checking initial data","title":"Design experiments for batches","text":"can check issues experimental point view via check_data(): can see warnings get collections problems. general, try least 3 replicates condition try data variable.","code":"check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one #> sample. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"picking-samples-for-each-batch","dir":"","previous_headings":"Example","what":"Picking samples for each batch","title":"Design experiments for batches","text":"Imagine can work groups 70, want randomize Sex, Smoke, Age, hand. 1.6543999^{61} combinations samples per batch experiment. However, combinations right handed students batch making impossible compare right handed students others draw conclusions . check combinations select allow us comparison. long experDesign can try find combination best design comparing combination original according multiple statistics. can transform vector append file pass colleague :","code":"# To reduce the variables used: omit <- c(\"Wr.Hnd\", \"NW.Hnd\", \"Fold\", \"Pulse\", \"Clap\", \"Exer\", \"Height\", \"M.I\") (keep <- colnames(survey)[!colnames(survey) %in% omit]) #> [1] \"Sex\" \"W.Hnd\" \"Smoke\" \"Age\" head(survey[, keep]) #> Sex W.Hnd Smoke Age #> 1 Female Right Never 18.250 #> 2 Male Left Regul 17.583 #> 3 Male Right Occas 16.917 #> 4 Male Right Never 20.333 #> 5 Male Right Never 23.667 #> 6 Female Right Never 21.000 # Set a seed for reproducibility set.seed(87732135) # Looking for groups at most of 70 samples. index <- design(pheno = survey, size_subset = 70, omit = omit, iterations = 100) #> Warning: There might be some problems with the data use check_data(). index #> $SubSet1 #> [1] 3 9 10 14 16 21 23 24 25 30 44 46 56 57 59 62 63 68 69 #> [20] 70 73 80 81 85 90 94 95 97 101 103 104 105 106 111 113 119 123 125 #> [39] 139 143 151 155 164 168 174 177 178 188 190 191 200 202 210 216 224 228 229 #> [58] 232 234 237 #> #> $SubSet2 #> [1] 5 6 11 18 19 22 31 34 37 38 39 40 41 47 49 53 54 55 58 #> [20] 60 65 66 71 74 84 91 96 100 108 124 126 127 133 134 144 145 148 158 #> [39] 159 160 161 162 166 169 180 185 186 193 198 199 203 204 205 208 214 215 226 #> [58] 231 235 #> #> $SubSet3 #> [1] 1 2 13 15 26 27 36 42 48 50 51 52 61 64 67 72 76 77 78 #> [20] 86 92 98 102 107 110 115 117 118 120 121 130 136 138 140 141 142 147 156 #> [39] 167 171 173 176 184 189 194 196 197 206 209 211 212 217 218 219 221 222 227 #> [58] 230 233 #> #> $SubSet4 #> [1] 4 7 8 12 17 20 28 29 32 33 35 43 45 75 79 82 83 87 88 #> [20] 89 93 99 109 112 114 116 122 128 129 131 132 135 137 146 149 150 152 153 #> [39] 154 157 163 165 170 172 175 179 181 182 183 187 192 195 201 207 213 220 223 #> [58] 225 236 head(batch_names(index)) #> [1] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet4\" \"SubSet2\" \"SubSet2\" # Or via inspect() to keep it in a matrix format: head(inspect(index, survey[, keep])) #> Sex W.Hnd Smoke Age batch #> 1 Female Right Never 18.250 SubSet3 #> 2 Male Left Regul 17.583 SubSet3 #> 3 Male Right Occas 16.917 SubSet1 #> 4 Male Right Never 20.333 SubSet4 #> 5 Male Right Never 23.667 SubSet2 #> 6 Female Right Never 21.000 SubSet2"},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"previous-work","dir":"","previous_headings":"","what":"Previous work","title":"Design experiments for batches","text":"CRAN task View Experimental Design includes many packages relevant designing experiment collecting data, none provides manage samples already collected. Two packages allow distribute samples batches: OSAT package handles categorical variables numeric data. doesn’t work data. minDiff package reported Stats.SE, handles numeric categorical data. can optimize two nominal criteria. doesn’t work data. Omixer package handles numeric categorical data (converting categorical variables numeric). way either Pearson’s Chi-squared Test samples Kendall’s correlation. allow protect spots used. still designing experiment collected data DeclareDesign might relevant . Question Bioinformatics.SE made developing package.","code":""},{"path":"https://experdesign.llrs.dev/dev/index.html","id":"other","dir":"","previous_headings":"","what":"Other","title":"Design experiments for batches","text":"Please note project released Contributor Code Conduct. participating project agree abide terms.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Name the batch — batch_names","title":"Name the batch — batch_names","text":"Given index return name batches samples ","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Name the batch — batch_names","text":"","code":"batch_names(i)"},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Name the batch — batch_names","text":"list numeric indices.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Name the batch — batch_names","text":"character vector names batch index.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/batch_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Name the batch — batch_names","text":"","code":"index <- create_subset(100, 50, 2) batch <- batch_names(index) head(batch) #> [1] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet1\""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check experiment data — check_data","title":"Check experiment data — check_data","text":"order run successful experiment good design needed even measuring data. functions checks several heuristics good experiment warns found.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check experiment data — check_data","text":"","code":"check_data(pheno, omit = NULL, na.omit = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check experiment data — check_data","text":"pheno Data.frame variables sample, one row one sample. omit Character vector names columns omit. na.omit Check effects missing values .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check experiment data — check_data","text":"logical value indicating everything alright (TRUE) (FALSE).","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check experiment data — check_data","text":"","code":"rdata <- expand.grid(sex = c(\"M\", \"F\"), class = c(\"lower\", \"median\", \"high\")) rdata2 <- rbind(rdata, rdata) check_data(rdata2) #> [1] TRUE # \\donttest{ #Different warnings check_data(rdata) #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE check_data(rdata[-c(1, 3), ]) #> Warning: Two categorical variables don't have all combinations. #> Warning: There is a category with just one sample. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE data(survey, package = \"MASS\") check_data(survey) #> Warning: Two categorical variables don't have all combinations. #> Warning: Some values are missing. #> Warning: There is a combination of categories with no replicates; i.e. just one sample. #> [1] FALSE # }"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Check index distribution on batches — check_index","title":"Check index distribution on batches — check_index","text":"Report statistics subset variable compared original.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check index distribution on batches — check_index","text":"","code":"check_index(pheno, index, omit = NULL)"},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check index distribution on batches — check_index","text":"pheno Data.frame sample information. index list indices indicating samples go subset. omit Name columns pheno omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check index distribution on batches — check_index","text":"matrix differences original data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check index distribution on batches — check_index","text":"closer values 0, less difference original distribution, better randomization.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/check_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check index distribution on batches — check_index","text":"","code":"index <- create_subset(50, 24) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) check_index(metadata, index) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.70337556 0.64335530 0.25552717 #> weight 1.78087320 23.64064592 4.85755683 #> sex 0.08412415 0.08412415 0.07659676"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Compares two indexes — compare_index","title":"Compares two indexes — compare_index","text":"Compare distribution samples two different batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compares two indexes — compare_index","text":"","code":"compare_index(pheno, index1, index2)"},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compares two indexes — compare_index","text":"pheno data.frame samples characteristics normalize. index1, index2 list index sample, name column pheno batch subset character .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compares two indexes — compare_index","text":"matrix variables columns batch. Negative values indicate index1 better.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/compare_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compares two indexes — compare_index","text":"","code":"index1 <- create_subset(50, 24) index2 <- batch_names(create_subset(50, 24)) metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) compare_index(metadata, index1, index2) #> subgroups #> SubSet1 SubSet2 SubSet3 #> height 0.27800502 0.55676788 0.16930483 #> weight 1.27977491 -18.94390957 3.73226093 #> sex -0.03162073 -0.01803725 -0.02785387"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Create index of subsets of a data — create_subset","title":"Create index of subsets of a data — create_subset","text":"Index samples grouped batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create index of subsets of a data — create_subset","text":"","code":"create_subset(size_data, size_subset = NULL, n = NULL, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create index of subsets of a data — create_subset","text":"size_data numeric value amount samples distribute. size_subset numeric value amount samples per batch. n numeric value number batches. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create index of subsets of a data — create_subset","text":"random list indices samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/create_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create index of subsets of a data — create_subset","text":"","code":"index <- create_subset(100, 50, 2)"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment — design","title":"Design a batch experiment — design","text":"Given samples distribute several batches, trying equal number samples per batch. can handle numeric categorical data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment — design","text":"","code":"design(pheno, size_subset, omit = NULL, iterations = 500, name = \"SubSet\")"},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment — design","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment — design","text":"indices samples go batch.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment — design","text":"","code":"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] 16 19 23 27 28 35 37 42 54 64 74 86 90 91 92 94 96 100 106 #> [20] 116 119 120 122 124 127 128 136 137 139 154 156 159 178 181 202 204 205 207 #> [39] 208 209 212 218 219 222 223 226 229 237 #> #> $SubSet2 #> [1] 11 13 24 26 34 45 47 58 59 69 75 83 84 88 89 97 103 109 110 #> [20] 118 129 130 142 145 146 149 152 153 160 162 166 171 175 179 184 187 191 193 #> [39] 194 197 199 200 210 220 228 231 234 235 #> #> $SubSet3 #> [1] 1 9 12 14 15 17 20 21 29 30 31 38 43 44 46 48 52 53 55 #> [20] 60 67 76 79 80 82 95 98 107 112 133 138 144 147 150 151 157 169 174 #> [39] 176 188 190 198 206 216 221 227 236 #> #> $SubSet4 #> [1] 2 8 10 18 22 25 32 33 36 39 40 41 49 51 56 61 62 63 68 #> [20] 72 73 93 99 101 104 108 113 126 131 132 134 140 141 143 148 163 164 165 #> [39] 167 180 182 186 189 201 203 224 232 #> #> $SubSet5 #> [1] 3 4 5 6 7 50 57 65 66 70 71 77 78 81 85 87 102 105 111 #> [20] 114 115 117 121 123 125 135 155 158 161 168 170 172 173 177 183 185 192 195 #> [39] 196 211 213 214 215 217 225 230 233 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribution by batch — distribution","title":"Distribution by batch — distribution","text":"Checks values maximally distributed several batches. Aimed categorical variables.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribution by batch — distribution","text":"","code":"distribution(report, column)"},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribution by batch — distribution","text":"report data.frame must contain batch column. can obtained inspect(). column name column one wants inspect.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribution by batch — distribution","text":"TRUE values maximal distributed, otherwise FALSE.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/distribution.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribution by batch — distribution","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") nas <- c(137, 70) # Omit rows with NA to avoid warnings in design index <- design(pheno = survey[-nas, columns], size_subset = 70, iterations = 10) batches <- inspect(index, survey[-nas, columns]) distribution(batches, \"Sex\") #> [1] TRUE distribution(batches, \"Smoke\") #> [1] TRUE"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the entropy — entropy","title":"Calculates the entropy — entropy","text":"Calculates entropy category. uses amount categories scale 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the entropy — entropy","text":"","code":"entropy(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the entropy — entropy","text":"x character vector two categories","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the entropy — entropy","text":"numeric value Shannon entropy scaled 0 1.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calculates the entropy — entropy","text":"omits NA present.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculates the entropy — entropy","text":"","code":"entropy(c(\"H\", \"T\", \"H\", \"T\")) #> [1] 1 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", \"H\")) #> [1] 0.8631206 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\", NA)) #> [1] 0.9182958 entropy(c(\"H\", \"T\", \"H\", \"T\", \"H\", \"H\")) #> [1] 0.9182958 entropy(c(\"H\", \"H\", \"H\", \"H\", \"H\", \"H\", NA)) #> [1] 0"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate entropy — evaluate_entropy","title":"Evaluate entropy — evaluate_entropy","text":"Looks nominal character columns equally distributed according entropy taking account independence batches. column different row assumed sample names thus omitted.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate entropy — evaluate_entropy","text":"","code":"evaluate_entropy(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate entropy — evaluate_entropy","text":"list numeric indices data.frame pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate entropy — evaluate_entropy","text":"Value minimize","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate entropy — evaluate_entropy","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_entropy(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.007264842 0.481002114"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare independence by chisq.test — evaluate_independence","title":"Compare independence by chisq.test — evaluate_independence","text":"Looks independence categories batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"evaluate_independence(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare independence by chisq.test — evaluate_independence","text":"Index subsets. pheno data.frame information samples.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare independence by chisq.test — evaluate_independence","text":"Returns vector p-values chisq.test category subset.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_independence.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compare independence by chisq.test — evaluate_independence","text":"","code":"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(). # Note that numeric columns will be omitted: evaluate_independence(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Sex Smoke #> 0.09211905 0.50037711"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates a data.frame — evaluate_index","title":"Evaluates a data.frame — evaluate_index","text":"Measures several indicators per group","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates a data.frame — evaluate_index","text":"","code":"evaluate_index(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates a data.frame — evaluate_index","text":"Index pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates a data.frame — evaluate_index","text":"array three dimensions mean, standard deviation (sd()), median absolute deviation (mad()) numeric variables, entropy categorical number NA subgroup.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates a data.frame — evaluate_index","text":"","code":"data(survey, package = \"MASS\") index <- create_subset(nrow(survey), 50, 5) ev_index <- evaluate_index(index, survey[, c(\"Sex\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). ev_index[\"entropy\", , ] #> subgroups #> variables SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> Sex 0.9949848 0.9544340 1.0000000 0.9970591 0.9918208 #> Smoke 0.4001934 0.4855790 0.4487245 0.6082579 0.5376809 #> mix_cat 0.6660806 0.6605638 0.6587911 0.7305701 0.7266037"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate median absolute deviation — evaluate_mad","title":"Evaluate median absolute deviation — evaluate_mad","text":"Looks median absolute deviation values subgroup.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"evaluate_mad(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate median absolute deviation — evaluate_mad","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate median absolute deviation — evaluate_mad","text":"vector mean difference median absolute deviation group original mad.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mad.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate median absolute deviation — evaluate_mad","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mad(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 25.90814"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_mean","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"Looks mean numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"evaluate_mean(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"List indices pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"matrix mean value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_mean.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_mean","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_mean(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 0.2733898"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate the dispersion of NAs — evaluate_na","title":"Evaluate the dispersion of NAs — evaluate_na","text":"Looks NA distributed subset","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"evaluate_na(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate the dispersion of NAs — evaluate_na","text":"list numeric indices data.frame pheno Data.frame","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate the dispersion of NAs — evaluate_na","text":"optimum value reduce","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate the dispersion of NAs — evaluate_na","text":"","code":"samples <- 10 m <- matrix(rnorm(samples), nrow = samples) m[sample(seq_len(samples), size = 5), ] <- NA # Some NA i <- create_subset(samples, 3, 4) # random subsets evaluate_na(i, m) #> [1] 0.375"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluate each variable provided — evaluate_orig","title":"Evaluate each variable provided — evaluate_orig","text":"Measure summary statistics whole cohort samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"evaluate_orig(pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluate each variable provided — evaluate_orig","text":"pheno Data.frame information samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluate each variable provided — evaluate_orig","text":"matrix mean, standard deviation, MAD values numeric variables, entropy categorical, amount NA per variable.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_orig.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluate each variable provided — evaluate_orig","text":"","code":"data(survey, package = \"MASS\") evaluate_orig(survey[, c(\"Sex\", \"Age\", \"Smoke\")]) #> Warning: There might be some problems with the data use check_data(). #> Sex Age Smoke mix_cat #> mean 0 20.374515 0.0000000 0.0000000 #> sd 0 6.474335 0.0000000 0.0000000 #> mad 0 1.605656 0.0000000 0.0000000 #> na 1 0.000000 1.0000000 0.0000000 #> entropy 1 0.000000 0.5143828 0.6268135 #> independence 0 0.000000 0.0000000 0.0000000"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":null,"dir":"Reference","previous_headings":"","what":"Evaluates the mean of the numeric values — evaluate_sd","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"Looks standard deviation numeric values","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"evaluate_sd(i, pheno)"},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"List indices pheno Data.frame samples","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"matrix standard deviation value column subset","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/evaluate_sd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Evaluates the mean of the numeric values — evaluate_sd","text":"","code":"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(). # Note that categorical columns will be omitted: evaluate_sd(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")]) #> Age #> 1.647705"},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":null,"dir":"Reference","previous_headings":"","what":"experDesign: Expert experiment design in batches — experDesign-package","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Enables easy distribution samples per batch avoiding batch confounding effects randomization variables batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"important function design(), distributes samples batches according information provided. help bench inspect() function appends group data provided. grid spatial data, might want look spatial() function distribute samples keeping original design. case experiment half processed need extend can use follow_up() follow_up2(). helps selecting samples already used used follow .","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/experDesign-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"experDesign: Expert experiment design in batches — experDesign-package","text":"Lluís Revilla","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":null,"dir":"Reference","previous_headings":"","what":"Select the subset of extreme cases to evaluation — extreme_cases","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"Subset samples mostly different.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"extreme_cases(pheno, size, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"pheno Data.frame sample information. size number samples subset. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"vector number rows selected.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/extreme_cases.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Select the subset of extreme cases to evaluation — extreme_cases","text":"","code":"metadata <- expand.grid(height = seq(60, 80, 5), weight = seq(100, 300, 50), sex = c(\"Male\",\"Female\")) sel <- extreme_cases(metadata, 10) # We can see that it selected both Female and Males and wide range of height # and weight: metadata[sel, ] #> height weight sex #> 1 60 100 Male #> 4 75 100 Male #> 5 80 100 Male #> 13 70 200 Male #> 14 75 200 Male #> 21 60 300 Male #> 25 80 300 Male #> 29 75 100 Female #> 47 65 300 Female #> 48 70 300 Female"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments — follow_up","title":"Follow up experiments — follow_up","text":"experiment carried samples want continue samples later .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments — follow_up","text":"","code":"follow_up( original, follow_up, size_subset, omit = NULL, old_new = \"batch\", iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments — follow_up","text":"original data.frame information samples used originally. follow_up data.frame information new samples. size_subset Numeric value number sample per batch. omit Name columns pheno omitted. old_new Name column batch status stored. matches name column original used find previous batches. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments — follow_up","text":"data.frame common columns data, new column old_new, batch column filled new batches needed.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments — follow_up","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] fu <- follow_up(survey1, survey2, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> Warning: Column batch is already present. Did you meant this?"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":null,"dir":"Reference","previous_headings":"","what":"Follow up experiments in batches — follow_up2","title":"Follow up experiments in batches — follow_up2","text":"Design experiment data new old together.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Follow up experiments in batches — follow_up2","text":"","code":"follow_up2(all_data, batch_column = \"batch\", ...)"},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Follow up experiments in batches — follow_up2","text":"all_data data.frame data samples. row sample. batch_column name column all_data batches used. NA interpreted new data, empty considered batch. ... Arguments passed design size_subset Numeric value number sample per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed. name character used name subsets, either single one vector size n.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Follow up experiments in batches — follow_up2","text":"data.frame batch_column filled new batches needed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Follow up experiments in batches — follow_up2","text":"batch_column empty samples considered new. size_subset missing, estimated previous batch Similarly, iterations name guessed inferred samples.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/follow_up2.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Follow up experiments in batches — follow_up2","text":"","code":"data(survey, package = \"MASS\") # Create the first batch first_batch_n <- 118 variables <- c(\"Sex\", \"Smoke\", \"Age\") survey1 <- survey[seq_len(first_batch_n), variables] index1 <- design(survey1, size_subset = 50, iterations = 10) #> Warning: There might be some problems with the data use check_data(). r_survey <- inspect(index1, survey1) # Create the second batch with \"new\" students survey2 <- survey[seq(from = first_batch_n +1, to = nrow(survey)), variables] survey2$batch <- NA # Prepare the follow up all_classroom <- rbind(r_survey, survey2) follow_up2(all_classroom, size_subset = 50, iterations = 10) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet1\" #> [6] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [11] \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet1\" #> [16] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [21] \"SubSet1\" \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [26] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [31] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [36] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet3\" #> [41] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [46] \"SubSet2\" \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [51] \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet2\" #> [56] \"SubSet2\" \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" #> [61] \"SubSet1\" \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet1\" #> [66] \"SubSet2\" \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet2\" #> [71] \"SubSet3\" \"SubSet3\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [76] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet1\" \"SubSet2\" #> [81] \"SubSet1\" \"SubSet1\" \"SubSet3\" \"SubSet1\" \"SubSet3\" #> [86] \"SubSet2\" \"SubSet2\" \"SubSet2\" \"SubSet1\" \"SubSet3\" #> [91] \"SubSet2\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet2\" #> [96] \"SubSet1\" \"SubSet1\" \"SubSet2\" \"SubSet2\" \"SubSet3\" #> [101] \"SubSet2\" \"SubSet1\" \"SubSet3\" \"SubSet3\" \"SubSet2\" #> [106] \"SubSet3\" \"SubSet3\" \"SubSet1\" \"SubSet3\" \"SubSet1\" #> [111] \"SubSet3\" \"SubSet2\" \"SubSet3\" \"SubSet1\" \"SubSet1\" #> [116] \"SubSet3\" \"SubSet1\" \"SubSet3\" \"NewSubset1\" \"NewSubset3\" #> [121] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" #> [126] \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [131] \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [136] \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" \"NewSubset3\" #> [141] \"NewSubset2\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" #> [146] \"NewSubset3\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset2\" #> [151] \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" #> [156] \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [161] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [166] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" #> [171] \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" \"NewSubset3\" \"NewSubset2\" #> [176] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [181] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset1\" #> [186] \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [191] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset1\" #> [196] \"NewSubset1\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset1\" #> [201] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset2\" \"NewSubset2\" #> [206] \"NewSubset3\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" #> [211] \"NewSubset2\" \"NewSubset1\" \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" #> [216] \"NewSubset1\" \"NewSubset1\" \"NewSubset3\" \"NewSubset3\" \"NewSubset2\" #> [221] \"NewSubset2\" \"NewSubset1\" \"NewSubset3\" \"NewSubset1\" \"NewSubset3\" #> [226] \"NewSubset3\" \"NewSubset1\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [231] \"NewSubset3\" \"NewSubset2\" \"NewSubset2\" \"NewSubset3\" \"NewSubset3\" #> [236] \"NewSubset2\" \"NewSubset1\""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":null,"dir":"Reference","previous_headings":"","what":"Inspect the index — inspect","title":"Inspect the index — inspect","text":"Given index data samples append batch assignment","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Inspect the index — inspect","text":"","code":"inspect(i, pheno, omit = NULL, index_name = \"batch\")"},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Inspect the index — inspect","text":"List indices samples per batch pheno Data.frame sample information. omit Name columns pheno omitted. index_name Column name index resulting data.frame.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Inspect the index — inspect","text":"data.frame new column batch name batch sample goes .","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/inspect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Inspect the index — inspect","text":"","code":"data(survey, package = \"MASS\") columns <- c(\"Sex\", \"Age\", \"Smoke\") index <- design(pheno = survey[, columns], size_subset = 70, iterations = 10) #> Warning: There might be some problems with the data use check_data(). batches <- inspect(index, survey[, columns]) head(batches) #> Sex Age Smoke batch #> 1 Female 18.250 Never SubSet3 #> 2 Male 17.583 Regul SubSet4 #> 3 Male 16.917 Occas SubSet3 #> 4 Male 20.333 Never SubSet4 #> 5 Male 23.667 Never SubSet3 #> 6 Female 21.000 Never SubSet4"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":null,"dir":"Reference","previous_headings":"","what":"Optimum values for batches — optimum","title":"Optimum values for batches — optimum","text":"Calculates optimum values number batches size batches. need several batches can better distribute evenly add replicates.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optimum values for batches — optimum","text":"","code":"optimum_batches(size_data, size_subset) optimum_subset(size_data, batches) sizes_batches(size_data, size_subset, batches)"},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Optimum values for batches — optimum","text":"size_data numeric value number samples use. size_subset Numeric value number sample per batch. batches numeric value number batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Optimum values for batches — optimum","text":"optimum_batches numeric value number batches use. optimum_subset numeric value maximum number samples per batch data. sizes_batches numeric vector number samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/optimum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Optimum values for batches — optimum","text":"","code":"size_data <- 50 size_batch <- 24 (batches <- optimum_batches(size_data, size_batch)) #> [1] 3 # So now the best number of samples for each batch is less than the available (size <- optimum_subset(size_data, batches)) #> [1] 17 # The distribution of samples per batch sizes_batches(size_data, size, batches) #> [1] 17 17 16"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":null,"dir":"Reference","previous_headings":"","what":"Random subset — qcSubset","title":"Random subset — qcSubset","text":"Select randomly samples index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random subset — qcSubset","text":"","code":"qcSubset(index, size, each = FALSE)"},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random subset — qcSubset","text":"index list indices indicating samples go subset. size number samples taken. logical value subset taken samples batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/qcSubset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random subset — qcSubset","text":"","code":"set.seed(50) index <- create_subset(100, 50, 2) QC_samples <- qcSubset(index, 10) QC_samplesBatch <- qcSubset(index, 10, TRUE)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Design a batch experiment with experimental controls — replicates","title":"Design a batch experiment with experimental controls — replicates","text":"ensure batches comparable samples processed batch. function allows take account effect. uses different samples controls defined extreme_cases().","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"replicates(pheno, size_subset, controls, omit = NULL, iterations = 500)"},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design a batch experiment with experimental controls — replicates","text":"pheno Data.frame sample information. size_subset Numeric value number sample per batch. controls numeric value amount technical controls per batch. omit Name columns pheno omitted. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design a batch experiment with experimental controls — replicates","text":"index samples duplicated batches.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Design a batch experiment with experimental controls — replicates","text":"control variance replicates important, see example https://www.nature.com/articles/nmeth.3091.","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/replicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Design a batch experiment with experimental controls — replicates","text":"","code":"samples <- data.frame(L = letters[1:25], Age = rnorm(25), type = sample(LETTERS[1:5], 25, TRUE)) index <- replicates(samples, 5, controls = 2, omit = \"L\", iterations = 10) head(index) #> $SubSet1 #> [1] 1 7 12 19 21 #> #> $SubSet2 #> [1] 2 4 17 19 21 #> #> $SubSet3 #> [1] 6 18 19 21 25 #> #> $SubSet4 #> [1] 5 19 21 22 23 #> #> $SubSet5 #> [1] 3 8 11 19 21 #> #> $SubSet6 #> [1] 10 19 21 24 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":null,"dir":"Reference","previous_headings":"","what":"Distribute the sample on the plate — spatial","title":"Distribute the sample on the plate — spatial","text":"function assumes process batch samples distributed plate grid scheme.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Distribute the sample on the plate — spatial","text":"","code":"spatial( index, pheno, omit = NULL, remove_positions = NULL, rows = LETTERS[1:5], columns = 1:10, iterations = 500 )"},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distribute the sample on the plate — spatial","text":"index list samples subgroup, provided design() replicates(). pheno Data.frame sample information. omit Name columns pheno omitted. remove_positions Character, name positions avoided grid. rows Character, name rows used. columns Character, name rows used. iterations Numeric value iterations performed.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distribute the sample on the plate — spatial","text":"indices samples go batch.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/spatial.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Distribute the sample on the plate — spatial","text":"","code":"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(). index2 <- spatial(index, survey[, c(\"Sex\", \"Smoke\", \"Age\")], iterations = 10) head(index2) #> $A1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 8 207 16 107 150 #> #> $B1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 100 154 222 161 105 #> #> $C1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 88 163 209 71 1 #> #> $D1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 114 208 70 9 36 #> #> $E1 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 86 112 15 171 221 #> #> $A2 #> SubSet1 SubSet2 SubSet3 SubSet4 SubSet5 #> 176 224 46 133 235 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a factor to index — use_index","title":"Convert a factor to index — use_index","text":"Convert given factor accepted index","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a factor to index — use_index","text":"","code":"use_index(x)"},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a factor to index — use_index","text":"x character factor used index","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/use_index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert a factor to index — use_index","text":"","code":"plates <- c(\"P1\", \"P2\", \"P1\", \"P2\", \"P2\", \"P3\", \"P1\", \"P3\", \"P1\", \"P1\") use_index(plates) #> $P1 #> [1] 1 3 7 9 10 #> #> $P2 #> [1] 2 4 5 #> #> $P3 #> [1] 6 8 #>"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":null,"dir":"Reference","previous_headings":"","what":"Check the data for a follow up experiment. — valid_followup","title":"Check the data for a follow up experiment. — valid_followup","text":"Sometimes samples collected analyzed, later another batch samples analyzed. function tries detect problems data data combined single analysis. know specific problems data need use check_data()","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"valid_followup( old_data = NULL, new_data = NULL, all_data = NULL, omit = NULL, column = \"batch\" )"},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check the data for a follow up experiment. — valid_followup","text":"old_data, new_data data.frame old new data respectively. all_data data.frame data samples. row sample. omit Name columns pheno omitted. column name column old data batch information, whether data new (NA) case all_data.","code":""},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check the data for a follow up experiment. — valid_followup","text":"Called side effects warnings, returns logical value issues (FALSE) (TRUE)","code":""},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/reference/valid_followup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check the data for a follow up experiment. — valid_followup","text":"","code":"data(survey, package = \"MASS\") survey1 <- survey[1:118, ] survey2 <- survey[119:nrow(survey), ] valid_followup(survey1, survey2) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE survey$batch <- NA survey$batch[1:118] <- \"old\" valid_followup(all_data = survey) #> Warning: There are some problems with the data. #> Warning: There are some problems with the new samples and the batches. #> Warning: There are some problems with the new data. #> Warning: There are some problems with the old data. #> [1] FALSE"},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-development-version","dir":"Changelog","previous_headings":"","what":"experDesign (development version)","title":"experDesign (development version)","text":"Check index used inspect valid length, positions replications matching data provided. check_data() gains new omit argument (#49). relied positional arguments break scripts. Omitting non existing columns now creates warning.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-030","dir":"Changelog","previous_headings":"","what":"experDesign 0.3.0","title":"experDesign 0.3.0","text":"CRAN release: 2024-02-20 Fixed bug spatial() multiple samples assigned position plate (#45). Added warning batch_names() index repeated positions (revealed #45).","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-020","dir":"Changelog","previous_headings":"","what":"experDesign 0.2.0","title":"experDesign 0.2.0","text":"CRAN release: 2023-04-05 New follow_up() follow_up2() continue experiment safely (#22). New check_data() check input data (#37). New compare_index() compare different indexes per batch. Use categories combined (column mix_cat) comparing batches. Increased internal coherence checks. Added thesis advisers description. Update documentation.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-010","dir":"Changelog","previous_headings":"","what":"experDesign 0.1.0","title":"experDesign 0.1.0","text":"CRAN release: 2021-04-22 Added reference new package Omixer README. Fixed batches sizes errors. Speed increase (5x) design, spatial replicates. Update Code Conduct. Add online documentation url.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-004","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.4","title":"experDesign 0.0.4","text":"CRAN release: 2020-09-28 Remove BiocStyle dependency. Gain ability name subsets. Add examples functions. Add function consider spatial distribution plates/machines.","code":""},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-002","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.2","title":"experDesign 0.0.2","text":"CRAN release: 2020-09-08 CRAN release","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":"https://experdesign.llrs.dev/dev/news/index.html","id":"experdesign-0009000","dir":"Changelog","previous_headings":"","what":"experDesign 0.0.0.9000","title":"experDesign 0.0.0.9000","text":"Added NEWS.md file track changes package.","code":""}]