Skip to contents

Data frame generator with randomized columns

Usage

data_frame_of(..., rows = c(1L, 10L), cols = c(1L, 10L))

Arguments

...

A set of unnamed generators. The generated data frames will be built with random combinations of these generators.

rows

Number of rows of the generated data frame. If rows is a single number all data frames will have this number of rows. If rows is a numeric vector of length 2 it will produce data frames with rows between a minimum and maximum, inclusive. For example rows = c(1L, 10L) would produce data frames with rows between 1 and 10. To produce empty tibbles set rows = 0L or a range like rows = c(0L, 10L).

cols

Number of columns of the generated data frame. If cols is a single number all data frames will have this number of columns. If cols is a numeric vector of length 2 it will produce data frames with columns between a minimum and maximum, inclusive. For example cols = c(1L, 10L) would produce data frames with columns between 1 and 10. To produce empty tibbles set cols = 0L or a range like cols = c(0L, 10L).

Value

A quickcheck_generator object.

Examples

data_frame_of(logical_(), date_()) %>% show_example()
#>    ...1       ...2  ...3  ...4
#> 1  TRUE 2260-03-10  TRUE  TRUE
#> 2  TRUE 2634-01-12  TRUE FALSE
#> 3 FALSE 2855-02-04 FALSE FALSE
#> 4  TRUE 1703-03-13  TRUE FALSE
#> 5  TRUE 2878-07-24  TRUE FALSE
#> 6  TRUE 2126-07-03  TRUE  TRUE
#> 7  TRUE 2344-09-12 FALSE FALSE
#> 8  TRUE 2000-06-17  TRUE  TRUE
data_frame_of(any_atomic(), rows = 10L, cols = 5L) %>% show_example()
#>     ...1            ...2       ...3  ...4            ...5
#> 1  FALSE 19:51:42.098083 -915086967  TRUE 15:04:18.213348
#> 2  FALSE 13:48:33.028629  397175604  TRUE 05:34:21.045055
#> 3   TRUE 23:35:06.137909  373899705 FALSE 02:22:33.579206
#> 4   TRUE 02:36:00.014100  412865603 FALSE 11:37:48.120076
#> 5   TRUE 09:43:49.613527 -470052447  TRUE 17:20:57.290634
#> 6   TRUE 05:58:49.220943  456814791 FALSE 12:20:34.200336
#> 7   TRUE 14:48:55.353276  227404026  TRUE 02:14:22.890544
#> 8   TRUE 05:08:22.231580  402899707  TRUE 04:54:21.013874
#> 9   TRUE 07:34:19.138893 -355332551 FALSE 00:47:36.365287
#> 10  TRUE 09:50:55.971901  350473005  TRUE 20:15:23.620469