emitanaka / edibble

An R-package that encapsulate elements of experimental design for better planning, management, and workflow
https://edibble.emitanaka.org
Other
215 stars 14 forks source link

Unassigned treatment where block size < treatment number #42

Closed emitanaka closed 2 years ago

emitanaka commented 2 years ago

In cases where block size < treatment size, some treatments by chance are not assigned. Currently it doesn't serve the table if that is the case(which is good) but random assignment algorithm needs to improve so unassigned treatment levels are minimised. Where unassigned treatment levels are unavoidable, e.g. total number of units < treatment levels, it should output an error

start_design("Unassigned treatment") %>%
    set_units(block = 2,
              row = 8,
              col = nested_in(block, 1 ~ 3,
                              2 ~ 4),
              unit = ~row:col) %>%
    set_trts(trt1 = 8,
             trt2 = 6) %>%
    allot_trts(trt1 ~ row,
               trt2 ~ col) %>%
    assign_trts("random", seed = 57) %>%
    serve_table()
Screen Shot 2022-01-30 at 4 55 44 pm
emitanaka commented 2 years ago

algorithm has been improved so this doesn't seem to be a problem anymore