Skip to contents

It randomly generates a square lattice design across locations.

Usage

square_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 square 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 square lattice design with 5 full blocks, 8 units per IBlock,
# 8 IBlocks for a square number of treatmens of 64 in two locations.
squareLattice1 <- square_lattice(t = 64, k = 8, r = 5, l = 2, 
                                 plotNumber = c(1001, 2001),
                                 locationNames = c("FARGO", "MINOT"), 
                                 seed = 1986)
squareLattice1$infoDesign
#> $Reps
#> [1] 5
#> 
#> $IBlocks
#> [1] 8
#> 
#> $NumberTreatments
#> [1] 64
#> 
#> $NumberLocations
#> [1] 2
#> 
#> $Locations
#> [1] "FARGO" "MINOT"
#> 
#> $seed
#> [1] 1986
#> 
#> $lambda
#> [1] 0.5555556
#> 
#> $id_design
#> [1] 10
#> 
head(squareLattice1$fieldBook,12)
#>    ID LOCATION PLOT REP IBLOCK UNIT ENTRY TREATMENT
#> 1   1    FARGO 1001   1      1    1    34      G-34
#> 2   2    FARGO 1002   1      1    2    58      G-58
#> 3   3    FARGO 1003   1      1    3    10      G-10
#> 4   4    FARGO 1004   1      1    4    18      G-18
#> 5   5    FARGO 1005   1      1    5    26      G-26
#> 6   6    FARGO 1006   1      1    6     2       G-2
#> 7   7    FARGO 1007   1      1    7    42      G-42
#> 8   8    FARGO 1008   1      1    8    50      G-50
#> 9   9    FARGO 1009   1      2    1    57      G-57
#> 10 10    FARGO 1010   1      2    2    25      G-25
#> 11 11    FARGO 1011   1      2    3    49      G-49
#> 12 12    FARGO 1012   1      2    4    41      G-41

# Example 2: Generates a square lattice design with 3 full blocks, 7 units per IBlock,
# 7 IBlocks for a square number of treatmens of 49 in one location.
# In this case, we show how to use the option data.
treatments <- paste("G", 1:49, sep = "")
ENTRY <- 1:49
treatment_list <- data.frame(list(ENTRY = ENTRY, TREATMENT = treatments))
head(treatment_list) 
#>   ENTRY TREATMENT
#> 1     1        G1
#> 2     2        G2
#> 3     3        G3
#> 4     4        G4
#> 5     5        G5
#> 6     6        G6
squareLattice2 <- square_lattice(t = 49, k = 7, r = 3, l = 1, 
                                 plotNumber = 1001,
                                 locationNames = "CASSELTON", 
                                 seed = 1986,
                                 data = treatment_list)
squareLattice2$infoDesign
#> $Reps
#> [1] 3
#> 
#> $IBlocks
#> [1] 7
#> 
#> $NumberTreatments
#> [1] 49
#> 
#> $NumberLocations
#> [1] 1
#> 
#> $Locations
#> [1] "CASSELTON"
#> 
#> $seed
#> [1] 1986
#> 
#> $lambda
#> [1] 0.375
#> 
#> $id_design
#> [1] 10
#> 
head(squareLattice2$fieldBook,12)
#>    ID  LOCATION PLOT REP IBLOCK UNIT ENTRY TREATMENT
#> 1   1 CASSELTON 1001   1      1    1    39       G39
#> 2   2 CASSELTON 1002   1      1    2    26       G26
#> 3   3 CASSELTON 1003   1      1    3    13       G13
#> 4   4 CASSELTON 1004   1      1    4    49       G49
#> 5   5 CASSELTON 1005   1      1    5    16       G16
#> 6   6 CASSELTON 1006   1      1    6     3        G3
#> 7   7 CASSELTON 1007   1      1    7    29       G29
#> 8   8 CASSELTON 1008   1      2    1    14       G14
#> 9   9 CASSELTON 1009   1      2    2    27       G27
#> 10 10 CASSELTON 1010   1      2    3     4        G4
#> 11 11 CASSELTON 1011   1      2    4    30       G30
#> 12 12 CASSELTON 1012   1      2    5    40       G40