Skip to contents

This function adds the edges between variable nodes to specify the mapping of units to treatment. This function does not actually assign specific treatment levels onto actual units.


allot_trts(.design, ..., .record = TRUE)



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


A logical value. This indicates whether to record this code step. The default is TRUE. It should remain TRUE unless this function is used as a wrapper in other code.

See also

Other user-facing functions: design-context, design(), expect_rcrds(), export_design(), serve_table(), set_rcrds(), set_trts(), set_units()


start_design() %>%
  set_units(block = 10,
            plot = nested_in(block, 3)) %>%
  set_trts(treat = c("A", "B", "C"),
           pest = c("a", "b")) %>%
  allot_trts(treat ~ plot,
                pest ~ block)
#> Warning: `start_design` is deprecated. Please use `design` instead.
#> An edibble design
#> ├─block (10 levels)
#> │ └─plot (30 levels)
#> ├─treat (3 levels)
#> └─pest (2 levels)
#> Allotment:
#> • treat ~ plot
#> • pest ~ block