This function add a special class, called edbl_trt, of edibble variables.

set_trts(
  .design,
  ...,
  .name_repair = c("check_unique", "unique", "universal", "minimal")
)

Arguments

...

Either a name-value pair or a series of the names.

.name_repair

Same as the argument in tibble::tibble().

Definition of treatment

The word treatment is sometimes used to refer to one of these variables. When there are more than one treatment variables then this unfortunately confuses whether treatment refers to the variable or the combination of all treatment variables.

Treatment is the whole description of what is applied in an experiment.

See also

Examples

start_design() %>% set_trts(pesticide = c("A", "B", "C"), dosage = c(0, 10, 20, 30, 40))
#> An edibble design #> ├─pesticide (3 levels) #> └─dosage (5 levels)
# you can set treatments to existing edibble lady_tasting_tea %>% edibble() %>% set_trts(first)
#> # An edibble: 8 x 4 #> cup first guess correct #> <fct> <trt(2)> <chr> <lgl> #> 1 1 milk milk TRUE #> 2 2 milk milk TRUE #> 3 3 milk milk TRUE #> 4 4 tea tea TRUE #> 5 5 tea tea TRUE #> 6 6 milk milk TRUE #> 7 7 tea tea TRUE #> 8 8 tea tea TRUE