Skip to contents

Conditional treatment is different to nested units as the levels are assumed to be distinct for the latter but not for the former.


nested_in(x, ...)

conditioned_on(x, ...)



The name of the parent unit to nest under.


a single number OR a sequence of two-sided formula where the left-hand side corresponds to the name of the level (or the level number) of x and the right-hand side is an integer specifying the number of levels nested under the corresponding levels.


A nested level.


Currently when specifying conditional treatment, only character vectors are accepted on the RHS.

See also

See set_units() for examples of how to use this.


design("Split-Plot Design | Split-Unit Design") %>%
  set_units(mainplot = 60,
            subplot = nested_in(mainplot, 10))
#> Split-Plot Design | Split-Unit Design
#> └─mainplot (60 levels)
#>   └─subplot (600 levels)