Skip to contents

Fabricate functions that construct example datasets

Usage

example_data_factory(data)

Examples

data <- tibble::tibble(x = 1, y = 1)
example_data <- example_data_factory(data)

example_data()
#> # A tibble: 1 × 2
#>       x     y
#>   <dbl> <dbl>
#> 1     1     1

col <- "x"
example_data(!!col := 1:2)
#> # A tibble: 2 × 2
#>       x     y
#>   <int> <dbl>
#> 1     1     1
#> 2     2     1