Skip to contents

This converts an edibble graph object to a data frame called edibble. This function should be used when the design is in the final form (or close to the final form). The table can only be formed when the variables can be reconciled, otherwise it will be a data frame with zero rows.

Usage

serve_table(
  .edibble = NULL,
  label_nested = NULL,
  fail = c("error", "warn", "ignore"),
  .record = TRUE
)

Arguments

.edibble

An edibble design (edbl_design), an edibble data frame (edbl_table) or an object that contains the edibble data frame in the attribute design.

label_nested

The columns to show nested labels (if available). Tidyselect compatible.

fail

What to do when failing to convert graph to table.

.record

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.

Value

An edbl data frame with columns defined by vertices and rows displayed only if the vertices are connected and reconcile for output.

See also

Other user-facing functions: allot_trts(), allot_units(), design(), expect_rcrds(), export_design(), set_rcrds(), set_trts(), set_units()

Examples

design("Completely Randomised Design") %>%
  set_units(unit = 28) %>%
  set_trts(trt = 6) %>%
  allot_trts(trt ~ unit) %>%
  assign_trts("random", seed = 521) %>%
  serve_table()
#> # Completely Randomised Design 
#> # An edibble: 28 x 2
#>       unit    trt
#>    <U(28)> <T(6)>
#>      <chr>  <chr>
#>  1  unit01   trt5
#>  2  unit02   trt6
#>  3  unit03   trt1
#>  4  unit04   trt1
#>  5  unit05   trt5
#>  6  unit06   trt6
#>  7  unit07   trt2
#>  8  unit08   trt1
#>  9  unit09   trt3
#> 10  unit10   trt4
#> # ℹ 18 more rows