Objective Function for Factorial Design Optimization
Source:R/metrics.R
objective_function_factorial.RdObjective Function for Factorial Design Optimization
Arguments
- layout_df
A data frame representing the current design
- swap
A column name of the items to be swapped
- spatial_cols
Column name(s) of the spatial factors
- factorial_separator
A character used to separate treatments in the factorial design (default: "-")
- ...
Arguments passed on to
objective_functionadj_weightWeight for adjacency score (default: 1)
bal_weightWeight for balance score (default: 1)
row_columnName of column representing the row of the design (default: "row")
col_columnName of column representing the column of the design (default: "col")
Examples
treatment_a <- paste0("A", 1:8)
treatment_b <- paste0("B", 1:3)
treatments <- with(expand.grid(treatment_a, treatment_b), paste(Var1, Var2, sep = "-"))
df <- initialise_design_df(treatments, 24, 3, 8, 3)
objective_function_factorial(df, "treatment", c("row", "col", "block"))
#> $score
#> [1] 723
#>