Create a data frame for Latin square design
Usage
df.lsd(treatments, label, squares = 1, reuse = c("row", "col", "both"))
Arguments
- treatments
An integer vector where each element represents the number of levels of the corresponding treatment factor. A single integer (e.g.,
treatments = n
) specifies one treatment factor withn
levels. When multiple factors are provided, they are arranged in a factorial treatment factor design. For example,treatments = c(2, 3)
creates a 2x3 factorial design with the first factor having 2 levels and the second factor having 3 levels.- label
Optional. A list of character vectors, each corresponding to a treatment factor. The name of each vector specifies the factor's name, and its elements provide the labels for that factor's levels. If no labels are provided, default labels will be used. For a single treatment factor, the default is
list(trt = c("1", "2", ...))
, and for two treatment factors, the default islist(facA = c("1", "2", ...), facB = c("1", "2", ...))
. For split-plot designs, the defaults are similar but include the ".main" and ".sub" suffixes for main plot and subplot factors. For example:list(trt.main = c("1", "2", ...), trt.sub = c("1", "2", ...))
andlist(facA.main = c("1", "2", ...), facB.main = c("1", "2", ...), facA.sub = c("1", "2", ...), facB.sub = c("1", "2", ...))
. Label sets should be arranged so that the main plot factors come first, followed by the subplot factors.- squares
the number of replicated squares
- reuse
A character string specifying how to replicate squares when there are multiple squares. Options are: "row" for reusing row blocks, "col" for reusing column blocks, or "both" for reusing both row and column blocks to replicate a single square.