Skip to contents

Random tibble generator

Usage

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

Arguments

...

A set of unnamed generators. The generated tibbles 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

tibble_of(logical_(), date_()) %>% show_example()
#> # A tibble: 4 × 8
#>   ...1  ...2       ...3       ...4  ...5  ...6       ...7       ...8      
#>   <lgl> <date>     <date>     <lgl> <lgl> <date>     <date>     <date>    
#> 1 FALSE 2321-02-27 2260-04-09 FALSE FALSE 1245-12-30 2287-12-06 1030-04-12
#> 2 TRUE  2100-07-09 1551-09-17 FALSE FALSE 1736-02-05 2609-05-06 2430-11-25
#> 3 TRUE  2396-12-18 2624-08-30 TRUE  FALSE 1237-10-26 1540-10-03 1181-04-10
#> 4 FALSE 1576-11-13 1758-01-18 FALSE FALSE 1989-06-13 1459-04-18 1271-12-10
tibble_of(any_atomic(), rows = 10L, cols = 5L) %>% show_example()
#> # A tibble: 10 × 5
#>    ...1         ...2 ...3       ...4        ...5               
#>    <chr>       <int> <date>     <chr>       <dttm>             
#>  1 "e|3iJzQ"    8866 1870-03-24 "n>q"       1872-04-02 02:42:12
#>  2 "ARi<"      -5280 1480-03-21 "Kva@AD0\"" 2967-12-07 03:54:18
#>  3 "j"         -1260 1580-08-18 "jWr*C"     924-10-13 19:58:35 
#>  4 "J>jY+"     -1475 2198-10-30 "|w"        361-12-20 16:48:38 
#>  5 "RoL"          40 2231-11-19 "}A>a)\\f"  1471-04-19 18:39:24
#>  6 "hKx8 "      -443 2293-04-21 "lI{h#[B7$" 2873-10-14 07:33:42
#>  7 "[H1E&@me%"  7115 2975-10-07 "i(u}p"     2004-03-22 18:58:08
#>  8 "M5o"       -9404 1066-06-13 "_X\"m"     765-06-21 10:57:38 
#>  9 "}"          6400 2582-08-06 "1"         171-10-28 08:11:10 
#> 10 "E,Zw"      -7023 2725-10-29 "4po-OYYu~" 1344-04-20 02:13:56