Small data set referencing the current date

demo_data(n = 10, by = "-2 month")

Arguments

n

number of rows to return

by

string indicating the unit of time between dates in seq.Date(..., by = )

Value

Returns a data frame of size n.

Examples

demo_data()
#> # A tibble: 10 × 5
#>    group sales count on_sale date      
#>    <chr> <dbl> <dbl>   <dbl> <date>    
#>  1 a       101    35       1 2022-06-29
#>  2 a       102    34       0 2022-04-29
#>  3 b       103    33       1 2022-03-01
#>  4 b       104    32       0 2021-12-29
#>  5 c       105    31       1 2021-10-29
#>  6 c       106    30       0 2021-08-29
#>  7 d       107    29       1 2021-06-29
#>  8 d       108    28       0 2021-04-29
#>  9 e       109    27       1 2021-03-01
#> 10 e       110    26       0 2020-12-29

demo_data(n = 8, by = "1 day")
#> # A tibble: 8 × 5
#>   group sales count on_sale date      
#>   <chr> <dbl> <dbl>   <dbl> <date>    
#> 1 a       101    33       1 2022-06-29
#> 2 a       102    32       0 2022-06-30
#> 3 b       103    31       1 2022-07-01
#> 4 b       104    30       0 2022-07-02
#> 5 c       105    29       1 2022-07-03
#> 6 c       106    28       0 2022-07-04
#> 7 d       107    27       1 2022-07-05
#> 8 d       108    26       0 2022-07-06