Skip to contents

This function creates new nodes to edibble graph with the name corresponding to either the intended response that will be measured or a variable to be recorded.

Usage

set_rcrds(
  .edibble,
  ...,
  .name_repair = c("check_unique", "unique", "universal", "minimal"),
  .record = TRUE
)

set_rcrds_of(.edibble, ...)

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.

...

Name-value pair. The value should correspond to a single name of the unit defined in set_units. The name should be the name of the record variable.

.name_repair

Same as the argument in tibble::tibble().

.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 edibble design.

See also

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

Examples

takeout(menu_crd(t = 4, n = 10)) %>%
  set_rcrds(y = unit)
#> # Completely Randomised Design 
#> # An edibble: 10 x 3
#>          unit      trt      y
#>    <unit(10)> <trt(4)> <rcrd>
#>  1     unit1      trt1      o
#>  2     unit2      trt2      o
#>  3     unit3      trt4      o
#>  4     unit4      trt4      o
#>  5     unit5      trt1      o
#>  6     unit6      trt3      o
#>  7     unit7      trt4      o
#>  8     unit8      trt3      o
#>  9     unit9      trt2      o
#> 10     unit10     trt2      o

takeout(menu_crd(t = 4, n = 10)) %>%
  set_rcrds_of(unit = "y")
#> # Completely Randomised Design 
#> # An edibble: 10 x 3
#>          unit      trt      y
#>    <unit(10)> <trt(4)> <rcrd>
#>  1     unit1      trt4      o
#>  2     unit2      trt1      o
#>  3     unit3      trt2      o
#>  4     unit4      trt2      o
#>  5     unit5      trt3      o
#>  6     unit6      trt4      o
#>  7     unit7      trt4      o
#>  8     unit8      trt1      o
#>  9     unit9      trt1      o
#> 10     unit10     trt3      o