This function adds the edges between level nodes in an edibble graph that outlines the possible ways that the treatment may be allocated to the recipient units.

allocate_trts(.edibble, ...)

Arguments

...

One-sided or two-sided formula. If the input is a one-sided formula then the whole treatment is applied to the specified unit.

.data

An edbl_graph object.

class

A sub-class. This is meant so that it can invoke the method randomise_trts.class.

See also

Examples

start_design() %>% set_units(block = 10, plot = nested_in(block, 3)) %>% set_trts(treat = c("A", "B", "C"), pest = c("a", "b")) %>% allocate_trts(treat ~ plot, pest ~ block)
#> An edibble design #> ├─block (10 levels) #> │ └─plot (30 levels) #> ├─treat (3 levels) #> └─pest (2 levels)
# allocation works on edibble table too lady_tasting_tea %>% edibble() %>% set_units(cup) %>% set_trts(first) %>% allocate_trts(first ~ cup)
#> # An edibble: 8 x 4 #> cup first guess correct #> <unit(8)> <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