Skip to contents

It randomly generates a rectangular lattice design across locations.

Usage

rectangular_lattice(
  t = NULL,
  k = NULL,
  r = NULL,
  l = 1,
  plotNumber = 101,
  locationNames = NULL,
  seed = NULL,
  data = NULL
)

Arguments

t

Number of treatments.

k

Size of incomplete blocks (number of units per incomplete block).

r

Number of blocks (full resolvable replicates).

l

Number of locations. By default l = 1.

plotNumber

Numeric vector with the starting plot number for each location. By default plotNumber = 101.

locationNames

(optional) Names for each location.

seed

(optional) Real number that specifies the starting seed to obtain reproducible designs.

data

(optional) Data frame with label list of treatments.

Value

A list with two elements.

  • infoDesign is a list with information on the design parameters.

  • fieldBook is a data frame with the rectangular lattice design field book.

References

Edmondson., R. N. (2021). blocksdesign: Nested and crossed block designs for factorial and unstructured treatment sets. https://CRAN.R-project.org/package=blocksdesign

Author

Didier Murillo [aut], Salvador Gezan [aut], Ana Heilman [ctb], Thomas Walk [ctb], Johan Aparicio [ctb], Richard Horsley [ctb]

Examples

# Example 1: Generates a rectangular lattice design with 6 full blocks, 4 units per IBlock (k)
# and 20 treatments in one location.
rectangularLattice1 <- rectangular_lattice(t = 20, k = 4, r = 6, l = 1, 
                                           plotNumber = 101,
                                           locationNames = "FARGO", 
                                           seed = 126)
rectangularLattice1$infoDesign
#> $Reps
#> [1] 6
#> 
#> $iBlocks
#> [1] 5
#> 
#> $NumberTreatments
#> [1] 20
#> 
#> $NumberLocations
#> [1] 1
#> 
#> $Locations
#> [1] "FARGO"
#> 
#> $seed
#> [1] 126
#> 
#> $lambda
#> [1] 0.9473684
#> 
#> $id_design
#> [1] 11
#> 
head(rectangularLattice1$fieldBook,12)
#>    ID LOCATION PLOT REP IBLOCK UNIT ENTRY TREATMENT
#> 1   1    FARGO  101   1      1    1    15      G-15
#> 2   2    FARGO  102   1      1    2    13      G-13
#> 3   3    FARGO  103   1      1    3    12      G-12
#> 4   4    FARGO  104   1      1    4    16      G-16
#> 5   5    FARGO  105   1      2    1    19      G-19
#> 6   6    FARGO  106   1      2    2    17      G-17
#> 7   7    FARGO  107   1      2    3    10      G-10
#> 8   8    FARGO  108   1      2    4    14      G-14
#> 9   9    FARGO  109   1      3    1    11      G-11
#> 10 10    FARGO  110   1      3    2     8       G-8
#> 11 11    FARGO  111   1      3    3     5       G-5
#> 12 12    FARGO  112   1      3    4    20      G-20

# Example 2: Generates a rectangular lattice design with 5 full blocks, 7 units per IBlock (k)
# and 56 treatments across 2 locations.
# In this case, we show how to use the option data.
treatments <- paste("ND-", 1:56, sep = "")
ENTRY <- 1:56
treatment_list <- data.frame(list(ENTRY = ENTRY, TREATMENT = treatments))
head(treatment_list) 
#>   ENTRY TREATMENT
#> 1     1      ND-1
#> 2     2      ND-2
#> 3     3      ND-3
#> 4     4      ND-4
#> 5     5      ND-5
#> 6     6      ND-6
rectangularLattice2 <- rectangular_lattice(t = 56, k = 7, r = 5, l = 2, 
                                           plotNumber = c(1001,2001),
                                           locationNames = c("Loc1", "Loc2"), 
                                           seed = 127,
                                           data = treatment_list)
rectangularLattice2$infoDesign
#> $Reps
#> [1] 5
#> 
#> $iBlocks
#> [1] 8
#> 
#> $NumberTreatments
#> [1] 56
#> 
#> $NumberLocations
#> [1] 2
#> 
#> $Locations
#> [1] "LOC1" "LOC2"
#> 
#> $seed
#> [1] 127
#> 
#> $lambda
#> [1] 0.5454545
#> 
#> $id_design
#> [1] 11
#> 
head(rectangularLattice2$fieldBook,12)
#>    ID LOCATION PLOT REP IBLOCK UNIT ENTRY TREATMENT
#> 1   1     LOC1 1001   1      1    1     8      ND-8
#> 2   2     LOC1 1002   1      1    2    35     ND-35
#> 3   3     LOC1 1003   1      1    3    52     ND-52
#> 4   4     LOC1 1004   1      1    4    29     ND-29
#> 5   5     LOC1 1005   1      1    5    41     ND-41
#> 6   6     LOC1 1006   1      1    6    22     ND-22
#> 7   7     LOC1 1007   1      1    7    10     ND-10
#> 8   8     LOC1 1008   1      2    1    45     ND-45
#> 9   9     LOC1 1009   1      2    2    11     ND-11
#> 10 10     LOC1 1010   1      2    3     6      ND-6
#> 11 11     LOC1 1011   1      2    4    25     ND-25
#> 12 12     LOC1 1012   1      2    5    34     ND-34