Fabricate functions that construct example datasets
Source:R/example_data_factory.R
example_data_factory.Rd
Fabricate functions that construct example datasets
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