Learn R Programming

FielDHub (version 1.4.2)

square_lattice: Generates a Square Lattice Design.

Description

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
)

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.

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.

Author

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

References

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

Examples

Run this code
# 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
head(squareLattice1$fieldBook,12)

# 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) 
squareLattice2 <- square_lattice(t = 49, k = 7, r = 3, l = 1, 
                                 plotNumber = 1001,
                                 locationNames = "CASSELTON", 
                                 seed = 1986,
                                 data = treatment_list)
squareLattice2$infoDesign
head(squareLattice2$fieldBook,12)

Run the code above in your browser using DataLab