# 30 rats
design() %>%
set_units(rat = 30) %>%
serve_table()
# 4 girls named "Anna", "Betty", "Carol", "Diana"
design() %>%
set_units(girl = c("Anna", "Betty", "Carol", "Diana")) %>%
serve_table()
# 3 companies, with 10 boxes each
design() %>%
set_units(company = c("A", "B", "C"),
box = nested_in(company, 10))
# 2 classes, one with 10 students, the other with 20 students
design() %>%
set_units(class = 2,
student = nested_in(class,
1 ~ 10,
2 ~ 20))
# 4 countries with 10 people from Australia & New Zealand and 20 from the rest
design() %>%
set_units(country = c("AU", "NZ", "USA", "JPN"),
person = nested_in(country,
c("AU", "NZ") ~ 10,
. ~ 20)) %>%
serve_table()
Run the code above in your browser using DataLab