Generates a Spatial Partially Replicated Arrangement Design
Source:R/fct_partially_replicated.R
partially_replicated.Rd
Randomly generates a spatial partially replicated design, where the distance between checks is maximized in such a way that each row and column have control plots. Note that design generation needs the dimension of the field (number of rows and columns).
Usage
partially_replicated(
nrows = NULL,
ncols = NULL,
repGens = NULL,
repUnits = NULL,
planter = "serpentine",
l = 1,
plotNumber = 101,
seed = NULL,
exptName = NULL,
locationNames = NULL,
data = NULL
)
Arguments
- nrows
Number of rows field.
- ncols
Number of columns field.
- repGens
Numeric vector with the amount genotypes to replicate.
- repUnits
Numeric vector with the number of reps of each genotype.
- planter
Option for
serpentine
orcartesian
movement. By defaultplanter = 'serpentine'
.- l
Number of locations. By default
l = 1
.- plotNumber
Numeric vector with the starting plot number for each location. By default
plotNumber = 101
.- seed
(optional) Real number that specifies the starting seed to obtain reproducible designs.
- exptName
(optional) Name of the experiment.
- locationNames
(optional) Name for each location.
- data
(optional) Dataframe with 3 columns:
ENTRY | NAME | REPS
.
Value
A list with five elements.
infoDesign
is a list with information on the design parameters.layoutRandom
is a matrix with the randomization layout.plotNumber
is a matrix with the layout plot number.dataEntry
is a data frame with the data input.genEntries
is a list with the entries for replicated and no replicated part.fieldBook
is a data frame with field book design. This includes the index (Row, Column).
References
Cullis, S., B. R., & Coombes, N. E. (2006). On the design of early generation variety trials with correlated data. Journal of Agricultural, Biological, and Environmental Statistics, 11, 381–393. https://doi.org/10.1198/108571106X154443
Author
Didier Murillo [aut], Salvador Gezan [aut], Ana Heilman [ctb], Thomas Walk [ctb], Johan Aparicio [ctb], Richard Horsley [ctb]
Examples
# Example 1: Generates a spatial optimized partially replicated arrangement design in one
# location with 312 genotypes for a field with dimensions 15 rows x 28 cols.
# Note that there are 250 genotypes unreplicated (only one time), 50 genotypes replicated
# two times, and 10 genotypes replicated three times, and two checks 20 times each one.
SpatpREP1 <- partially_replicated(
nrows = 15,
ncols = 28,
repGens = c(250,50,10,1,1),
repUnits = c(1,2,3,20,20),
planter = "cartesian",
plotNumber = 101,
seed = 77
)
SpatpREP1$infoDesign
#> $rows
#> [1] 15
#>
#> $columns
#> [1] 28
#>
#> $treatments_with_reps
#> [1] 62
#>
#> $treatments_with_no_reps
#> [1] 250
#>
#> $locations
#> [1] 1
#>
#> $planter
#> [1] "cartesian"
#>
#> $seed
#> [1] 77
#>
#> $id_design
#> [1] 13
#>
SpatpREP1$layoutRandom
#> [[1]]
#> Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10 Col11 Col12 Col13
#> Row15 2 190 118 200 242 298 45 269 265 33 55 17 248
#> Row14 257 191 1 2 2 123 171 206 137 1 1 172 40
#> Row13 22 167 2 244 42 45 67 89 229 117 294 142 70
#> Row12 8 243 34 2 177 155 267 63 58 75 130 39 146
#> Row11 106 122 14 310 81 141 60 204 129 144 50 65 9
#> Row10 278 179 199 25 27 32 47 18 48 296 276 53 48
#> Row9 26 147 115 223 297 13 186 236 54 80 1 143 193
#> Row8 1 6 79 108 100 73 4 69 224 251 234 35 16
#> Row7 301 252 250 87 1 34 192 2 295 131 198 238 5
#> Row6 258 40 259 312 280 110 116 12 2 203 19 46 293
#> Row5 72 2 151 36 256 196 305 148 126 3 274 205 2
#> Row4 162 2 6 107 41 218 20 15 24 38 59 134 281
#> Row3 272 124 173 43 232 62 170 47 201 9 240 84 208
#> Row2 56 13 3 228 1 2 158 145 46 36 285 33 97
#> Row1 109 14 11 39 275 254 1 58 157 253 159 185 165
#> Col14 Col15 Col16 Col17 Col18 Col19 Col20 Col21 Col22 Col23 Col24 Col25
#> Row15 270 44 1 26 120 49 299 1 96 189 184 24
#> Row14 20 182 99 44 219 2 178 261 1 209 23 213
#> Row13 246 60 222 2 226 188 31 217 181 211 71 32
#> Row12 140 132 279 160 86 303 197 1 61 2 125 37
#> Row11 153 94 30 74 57 78 1 210 85 27 68 54
#> Row10 154 291 1 10 114 287 119 230 21 150 277 249
#> Row9 2 1 4 290 25 28 156 286 7 247 82 104
#> Row8 8 311 76 121 90 288 11 30 9 220 1 194
#> Row7 2 2 93 233 307 15 283 28 212 52 152 66
#> Row6 7 113 111 41 61 161 8 241 133 55 95 237
#> Row5 264 51 202 52 2 262 273 1 239 51 6 183
#> Row4 164 221 23 255 64 139 282 3 207 302 175 214
#> Row3 10 260 5 102 11 77 1 29 289 300 43 1
#> Row2 266 127 187 105 4 29 271 215 195 5 57 98
#> Row1 88 56 149 227 174 50 12 128 10 180 53 19
#> Col26 Col27 Col28
#> Row15 35 245 231
#> Row14 1 268 42
#> Row13 306 62 37
#> Row12 16 103 38
#> Row11 138 292 163
#> Row10 176 135 136
#> Row9 304 17 216
#> Row8 284 2 235
#> Row7 18 83 168
#> Row6 49 22 7
#> Row5 101 21 112
#> Row4 308 31 2
#> Row3 309 263 59
#> Row2 225 169 91
#> Row1 12 92 166
#>
SpatpREP1$plotNumber
#> [[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 493 494 495 496 497 498 499 500 501 502 503 504 505
#> [2,] 465 466 467 468 469 470 471 472 473 474 475 476 477
#> [3,] 437 438 439 440 441 442 443 444 445 446 447 448 449
#> [4,] 409 410 411 412 413 414 415 416 417 418 419 420 421
#> [5,] 381 382 383 384 385 386 387 388 389 390 391 392 393
#> [6,] 353 354 355 356 357 358 359 360 361 362 363 364 365
#> [7,] 325 326 327 328 329 330 331 332 333 334 335 336 337
#> [8,] 297 298 299 300 301 302 303 304 305 306 307 308 309
#> [9,] 269 270 271 272 273 274 275 276 277 278 279 280 281
#> [10,] 241 242 243 244 245 246 247 248 249 250 251 252 253
#> [11,] 213 214 215 216 217 218 219 220 221 222 223 224 225
#> [12,] 185 186 187 188 189 190 191 192 193 194 195 196 197
#> [13,] 157 158 159 160 161 162 163 164 165 166 167 168 169
#> [14,] 129 130 131 132 133 134 135 136 137 138 139 140 141
#> [15,] 101 102 103 104 105 106 107 108 109 110 111 112 113
#> [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
#> [1,] 506 507 508 509 510 511 512 513 514 515 516 517
#> [2,] 478 479 480 481 482 483 484 485 486 487 488 489
#> [3,] 450 451 452 453 454 455 456 457 458 459 460 461
#> [4,] 422 423 424 425 426 427 428 429 430 431 432 433
#> [5,] 394 395 396 397 398 399 400 401 402 403 404 405
#> [6,] 366 367 368 369 370 371 372 373 374 375 376 377
#> [7,] 338 339 340 341 342 343 344 345 346 347 348 349
#> [8,] 310 311 312 313 314 315 316 317 318 319 320 321
#> [9,] 282 283 284 285 286 287 288 289 290 291 292 293
#> [10,] 254 255 256 257 258 259 260 261 262 263 264 265
#> [11,] 226 227 228 229 230 231 232 233 234 235 236 237
#> [12,] 198 199 200 201 202 203 204 205 206 207 208 209
#> [13,] 170 171 172 173 174 175 176 177 178 179 180 181
#> [14,] 142 143 144 145 146 147 148 149 150 151 152 153
#> [15,] 114 115 116 117 118 119 120 121 122 123 124 125
#> [,26] [,27] [,28]
#> [1,] 518 519 520
#> [2,] 490 491 492
#> [3,] 462 463 464
#> [4,] 434 435 436
#> [5,] 406 407 408
#> [6,] 378 379 380
#> [7,] 350 351 352
#> [8,] 322 323 324
#> [9,] 294 295 296
#> [10,] 266 267 268
#> [11,] 238 239 240
#> [12,] 210 211 212
#> [13,] 182 183 184
#> [14,] 154 155 156
#> [15,] 126 127 128
#>
head(SpatpREP1$fieldBook,12)
#> ID EXPT LOCATION YEAR PLOT ROW COLUMN CHECKS ENTRY TREATMENT
#> 1 1 Expt1 1 2022 101 1 1 0 109 G109
#> 2 2 Expt1 1 2022 102 1 2 14 14 G14
#> 3 3 Expt1 1 2022 103 1 3 11 11 G11
#> 4 4 Expt1 1 2022 104 1 4 39 39 G39
#> 5 5 Expt1 1 2022 105 1 5 0 275 G275
#> 6 6 Expt1 1 2022 106 1 6 0 254 G254
#> 7 7 Expt1 1 2022 107 1 7 1 1 G1
#> 8 8 Expt1 1 2022 108 1 8 58 58 G58
#> 9 9 Expt1 1 2022 109 1 9 0 157 G157
#> 10 10 Expt1 1 2022 110 1 10 0 253 G253
#> 11 11 Expt1 1 2022 111 1 11 0 159 G159
#> 12 12 Expt1 1 2022 112 1 12 0 185 G185
# Example 2: Generates a spatial optimized partially replicated arrangement design with 492
# genotypes in a field with dimensions 30 rows x 20 cols. Note that there 384 genotypes
# unreplicated (only one time), 108 genotypes replicated two times.
# In this case we don't have check plots.
# As example, we set up the data option with the entries list.
NAME <- paste("G", 1:492, sep = "")
repGens = c(108, 384);repUnits = c(2,1)
REPS <- rep(repUnits, repGens)
treatment_list <- data.frame(list(ENTRY = 1:492, NAME = NAME, REPS = REPS))
head(treatment_list, 12)
#> ENTRY NAME REPS
#> 1 1 G1 2
#> 2 2 G2 2
#> 3 3 G3 2
#> 4 4 G4 2
#> 5 5 G5 2
#> 6 6 G6 2
#> 7 7 G7 2
#> 8 8 G8 2
#> 9 9 G9 2
#> 10 10 G10 2
#> 11 11 G11 2
#> 12 12 G12 2
tail(treatment_list, 12)
#> ENTRY NAME REPS
#> 481 481 G481 1
#> 482 482 G482 1
#> 483 483 G483 1
#> 484 484 G484 1
#> 485 485 G485 1
#> 486 486 G486 1
#> 487 487 G487 1
#> 488 488 G488 1
#> 489 489 G489 1
#> 490 490 G490 1
#> 491 491 G491 1
#> 492 492 G492 1
SpatpREP2 <- partially_replicated(nrows = 30,
ncols = 20,
planter = "serpentine",
plotNumber = 101,
seed = 41,
data = treatment_list)
#> [1] 600
SpatpREP2$infoDesign
#> $rows
#> [1] 30
#>
#> $columns
#> [1] 20
#>
#> $treatments_with_reps
#> [1] 108
#>
#> $treatments_with_no_reps
#> [1] 384
#>
#> $locations
#> [1] 1
#>
#> $planter
#> [1] "serpentine"
#>
#> $seed
#> [1] 41
#>
#> $id_design
#> [1] 13
#>
SpatpREP2$layoutRandom
#> [[1]]
#> Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10 Col11 Col12 Col13
#> Row30 345 178 8 158 211 89 70 236 83 342 292 234 42
#> Row29 286 131 75 104 228 87 77 249 395 308 59 313 52
#> Row28 420 471 6 129 213 402 253 61 260 426 47 392 133
#> Row27 195 146 10 338 433 215 413 16 317 14 394 77 33
#> Row26 287 360 107 454 32 453 5 477 489 149 166 36 369
#> Row25 285 365 169 180 314 290 7 86 460 172 56 153 105
#> Row24 18 456 37 188 305 31 238 40 363 208 459 349 274
#> Row23 62 63 88 490 55 385 210 252 440 92 357 174 488
#> Row22 396 66 318 74 421 108 204 91 32 299 60 128 320
#> Row21 80 254 157 51 321 461 400 344 467 275 309 87 209
#> Row20 428 58 67 106 103 409 76 48 45 377 201 462 110
#> Row19 447 84 173 156 69 62 343 182 388 93 370 330 43
#> Row18 49 20 221 56 256 23 64 304 258 19 416 227 271
#> Row17 387 482 98 48 379 38 176 109 122 50 481 346 220
#> Row16 261 183 291 35 65 89 245 101 198 99 102 17 378
#> Row15 130 478 418 415 88 37 73 410 74 232 427 381 233
#> Row14 443 121 217 68 82 430 123 452 288 114 207 22 85
#> Row13 393 140 386 289 417 257 38 425 44 7 331 65 137
#> Row12 102 163 187 422 355 150 14 262 45 42 3 431 340
#> Row11 438 55 139 356 272 277 127 177 9 480 406 81 22
#> Row10 371 4 293 278 362 96 332 203 325 397 54 52 212
#> Row9 64 105 270 205 190 80 383 106 85 403 148 49 411
#> Row8 251 41 337 2 191 284 82 366 484 239 46 34 136
#> Row7 2 19 359 224 323 374 96 25 269 72 380 441 95
#> Row6 429 222 125 483 28 263 449 97 13 79 265 326 243
#> Row5 101 246 432 35 465 486 218 466 6 175 145 200 92
#> Row4 179 120 165 63 113 341 241 458 126 3 398 404 50
#> Row3 61 391 59 141 470 384 455 298 11 117 9 18 73
#> Row2 124 98 90 138 66 352 242 439 434 333 68 487 267
#> Row1 24 247 336 368 26 339 350 367 297 189 12 348 181
#> Col14 Col15 Col16 Col17 Col18 Col19 Col20
#> Row30 335 28 193 196 310 24 472
#> Row29 382 435 283 451 444 319 71
#> Row28 401 10 76 29 282 46 328
#> Row27 25 436 408 111 16 51 457
#> Row26 375 1 358 58 108 300 273
#> Row25 53 334 79 206 86 312 13
#> Row24 303 160 414 78 115 155 72
#> Row23 83 450 159 295 281 464 474
#> Row22 21 26 266 135 324 170 255
#> Row21 229 41 307 353 39 216 33
#> Row20 361 202 30 259 399 276 162
#> Row19 448 90 75 103 240 405 264
#> Row18 144 407 36 469 147 100 372
#> Row17 69 327 134 40 4 491 468
#> Row16 389 419 118 112 424 479 437
#> Row15 71 412 364 316 39 104 164
#> Row14 184 219 94 446 154 44 279
#> Row13 60 11 94 423 197 390 47
#> Row12 167 306 315 70 311 67 31
#> Row11 81 442 347 116 376 78 57
#> Row10 27 57 84 248 8 230 142
#> Row9 280 226 294 107 27 95 268
#> Row8 475 492 354 12 192 151 152
#> Row7 171 53 237 301 23 231 225
#> Row6 329 223 91 132 186 250 5
#> Row5 161 463 15 99 20 445 476
#> Row4 54 100 185 17 119 15 30
#> Row3 473 302 43 244 143 199 373
#> Row2 485 296 322 351 34 29 93
#> Row1 21 1 235 97 214 194 168
#>
SpatpREP2$plotNumber
#> [[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 700 699 698 697 696 695 694 693 692 691 690 689 688
#> [2,] 661 662 663 664 665 666 667 668 669 670 671 672 673
#> [3,] 660 659 658 657 656 655 654 653 652 651 650 649 648
#> [4,] 621 622 623 624 625 626 627 628 629 630 631 632 633
#> [5,] 620 619 618 617 616 615 614 613 612 611 610 609 608
#> [6,] 581 582 583 584 585 586 587 588 589 590 591 592 593
#> [7,] 580 579 578 577 576 575 574 573 572 571 570 569 568
#> [8,] 541 542 543 544 545 546 547 548 549 550 551 552 553
#> [9,] 540 539 538 537 536 535 534 533 532 531 530 529 528
#> [10,] 501 502 503 504 505 506 507 508 509 510 511 512 513
#> [11,] 500 499 498 497 496 495 494 493 492 491 490 489 488
#> [12,] 461 462 463 464 465 466 467 468 469 470 471 472 473
#> [13,] 460 459 458 457 456 455 454 453 452 451 450 449 448
#> [14,] 421 422 423 424 425 426 427 428 429 430 431 432 433
#> [15,] 420 419 418 417 416 415 414 413 412 411 410 409 408
#> [16,] 381 382 383 384 385 386 387 388 389 390 391 392 393
#> [17,] 380 379 378 377 376 375 374 373 372 371 370 369 368
#> [18,] 341 342 343 344 345 346 347 348 349 350 351 352 353
#> [19,] 340 339 338 337 336 335 334 333 332 331 330 329 328
#> [20,] 301 302 303 304 305 306 307 308 309 310 311 312 313
#> [21,] 300 299 298 297 296 295 294 293 292 291 290 289 288
#> [22,] 261 262 263 264 265 266 267 268 269 270 271 272 273
#> [23,] 260 259 258 257 256 255 254 253 252 251 250 249 248
#> [24,] 221 222 223 224 225 226 227 228 229 230 231 232 233
#> [25,] 220 219 218 217 216 215 214 213 212 211 210 209 208
#> [26,] 181 182 183 184 185 186 187 188 189 190 191 192 193
#> [27,] 180 179 178 177 176 175 174 173 172 171 170 169 168
#> [28,] 141 142 143 144 145 146 147 148 149 150 151 152 153
#> [29,] 140 139 138 137 136 135 134 133 132 131 130 129 128
#> [30,] 101 102 103 104 105 106 107 108 109 110 111 112 113
#> [,14] [,15] [,16] [,17] [,18] [,19] [,20]
#> [1,] 687 686 685 684 683 682 681
#> [2,] 674 675 676 677 678 679 680
#> [3,] 647 646 645 644 643 642 641
#> [4,] 634 635 636 637 638 639 640
#> [5,] 607 606 605 604 603 602 601
#> [6,] 594 595 596 597 598 599 600
#> [7,] 567 566 565 564 563 562 561
#> [8,] 554 555 556 557 558 559 560
#> [9,] 527 526 525 524 523 522 521
#> [10,] 514 515 516 517 518 519 520
#> [11,] 487 486 485 484 483 482 481
#> [12,] 474 475 476 477 478 479 480
#> [13,] 447 446 445 444 443 442 441
#> [14,] 434 435 436 437 438 439 440
#> [15,] 407 406 405 404 403 402 401
#> [16,] 394 395 396 397 398 399 400
#> [17,] 367 366 365 364 363 362 361
#> [18,] 354 355 356 357 358 359 360
#> [19,] 327 326 325 324 323 322 321
#> [20,] 314 315 316 317 318 319 320
#> [21,] 287 286 285 284 283 282 281
#> [22,] 274 275 276 277 278 279 280
#> [23,] 247 246 245 244 243 242 241
#> [24,] 234 235 236 237 238 239 240
#> [25,] 207 206 205 204 203 202 201
#> [26,] 194 195 196 197 198 199 200
#> [27,] 167 166 165 164 163 162 161
#> [28,] 154 155 156 157 158 159 160
#> [29,] 127 126 125 124 123 122 121
#> [30,] 114 115 116 117 118 119 120
#>
head(SpatpREP2$fieldBook,10)
#> ID EXPT LOCATION YEAR PLOT ROW COLUMN CHECKS ENTRY TREATMENT
#> 1 1 Expt1 1 2022 101 1 1 24 24 G24
#> 2 2 Expt1 1 2022 102 1 2 0 247 G247
#> 3 3 Expt1 1 2022 103 1 3 0 336 G336
#> 4 4 Expt1 1 2022 104 1 4 0 368 G368
#> 5 5 Expt1 1 2022 105 1 5 26 26 G26
#> 6 6 Expt1 1 2022 106 1 6 0 339 G339
#> 7 7 Expt1 1 2022 107 1 7 0 350 G350
#> 8 8 Expt1 1 2022 108 1 8 0 367 G367
#> 9 9 Expt1 1 2022 109 1 9 0 297 G297
#> 10 10 Expt1 1 2022 110 1 10 0 189 G189