Skip to contents

Set the expected values for recording variables

Usage

expect_rcrds(.edibble, ..., .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.

...

Name-value pairs with the name belonging to the variable that are plan to be recorded from set_rcrds() and the values are the expected types and values set by helper functions, see ?expect-rcrds.

.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_trts(), allot_units(), design(), export_design(), serve_table(), set_rcrds(), set_trts(), set_units()

Examples

takeout(menu_crd(t = 4, n = 10)) %>%
  set_rcrds(y = unit) %>%
  expect_rcrds(y > 0)
#> design("Completely Randomised Design") %>%
#>   set_units(unit = 10) %>%
#>   set_trts(trt = 4) %>%
#>   allot_trts(trt ~ unit) %>%
#>   assign_trts("random", seed = 780) %>%
#>   serve_table() 
#> 
#> # Completely Randomised Design 
#> # An edibble: 10 x 3
#>          unit      trt      y
#>    <unit(10)> <trt(4)> <rcrd>
#>         <chr>    <chr>  <dbl>                                                   
#>  1     unit1      trt1      o
#>  2     unit2      trt2      o
#>  3     unit3      trt3      o
#>  4     unit4      trt2      o
#>  5     unit5      trt3      o
#>  6     unit6      trt2      o
#>  7     unit7      trt4      o
#>  8     unit8      trt3      o
#>  9     unit9      trt1      o
#> 10     unit10     trt4      o