Data frame generator with randomized columns
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. Ifrows
is a numeric vector of length 2 it will produce data frames with rows between a minimum and maximum, inclusive. For examplerows = c(1L, 10L)
would produce data frames with rows between 1 and 10. To produce empty tibbles setrows = 0L
or a range likerows = 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. Ifcols
is a numeric vector of length 2 it will produce data frames with columns between a minimum and maximum, inclusive. For examplecols = c(1L, 10L)
would produce data frames with columns between 1 and 10. To produce empty tibbles setcols = 0L
or a range likecols = c(0L, 10L)
.
Examples
data_frame_of(logical_(), date_()) %>% show_example()
#> ...1 ...2 ...3 ...4 ...5 ...6 ...7 ...8 ...9 ...10
#> 1 FALSE 1349-09-07 1766-09-26 FALSE TRUE TRUE FALSE FALSE TRUE TRUE
#> 2 TRUE 2595-02-23 2408-10-07 FALSE TRUE FALSE FALSE TRUE FALSE FALSE
#> 3 TRUE 1641-03-21 1627-05-29 TRUE TRUE FALSE FALSE FALSE FALSE TRUE
#> 4 FALSE 2154-06-26 2105-12-13 FALSE TRUE TRUE FALSE TRUE FALSE TRUE
#> 5 TRUE 1203-08-22 1414-03-22 FALSE FALSE TRUE FALSE TRUE FALSE FALSE
#> 6 FALSE 1976-02-24 1062-06-07 FALSE TRUE FALSE FALSE TRUE FALSE TRUE
#> 7 FALSE 2089-06-19 2710-03-29 TRUE TRUE FALSE FALSE TRUE FALSE TRUE
data_frame_of(any_atomic(), rows = 10L, cols = 5L) %>% show_example()
#> ...1 ...2 ...3 ...4 ...5
#> 1 [e7s& 1365-12-04 2371-02-14 17:25:20 2885-01-02 189-01-26 13:17:57
#> 2 i0vVhdHgZ 1855-05-01 1106-12-16 08:44:11 1541-03-10 750-12-21 06:07:34
#> 3 x}E*KW[2 1158-10-14 423-12-15 08:55:48 2294-04-17 1253-07-02 09:31:44
#> 4 (e{P 1469-06-16 2888-06-18 10:04:32 1282-06-22 2889-03-25 05:03:44
#> 5 T4wqPv.2 2145-02-07 1790-07-19 05:13:15 2077-10-08 1305-10-03 20:01:58
#> 6 }[&% 2793-03-04 267-04-16 23:17:02 2389-09-04 409-09-19 08:55:38
#> 7 4TpG 2160-03-03 2126-05-04 13:40:13 2866-10-04 1538-08-30 02:45:07
#> 8 C-h% 1914-08-04 2658-11-09 09:21:35 1919-12-24 2920-03-05 14:07:43
#> 9 :<aCsKls 1080-09-06 1582-09-20 10:57:03 2447-02-07 2939-05-05 20:05:11
#> 10 KcvH3ZN 1693-02-15 2817-01-13 21:58:50 2983-11-17 407-06-17 05:02:28