Random tibble generator
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. 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
tibble_of(logical_(), date_()) %>% show_example()
#> # A tibble: 9 × 3
#> ...1 ...2 ...3
#> <date> <lgl> <lgl>
#> 1 1788-11-18 TRUE TRUE
#> 2 1861-08-21 TRUE TRUE
#> 3 2938-11-12 FALSE FALSE
#> 4 1782-01-31 TRUE TRUE
#> 5 2087-08-15 TRUE FALSE
#> 6 2786-09-22 TRUE TRUE
#> 7 1233-08-08 TRUE TRUE
#> 8 1947-03-26 FALSE TRUE
#> 9 1728-11-07 FALSE FALSE
tibble_of(any_atomic(), rows = 10L, cols = 5L) %>% show_example()
#> # A tibble: 10 × 5
#> ...1 ...2 ...3 ...4 ...5
#> <dttm> <chr> <int> <date> <int>
#> 1 2311-10-24 23:03:52 g-5xF -5761 2844-09-08 9381
#> 2 2131-03-04 06:19:54 { 2874 2578-10-21 0
#> 3 1543-06-03 04:01:18 %_ -2373 1465-03-13 -391
#> 4 237-12-27 05:27:39 dj9;&7c 6670 2037-05-09 -6748
#> 5 15-11-21 01:52:27 ;VT 1893 2795-06-06 1014
#> 6 1401-08-09 21:58:56 M'E01m -3268 1104-02-17 4938
#> 7 748-11-15 22:53:42 ^(t -9728 2332-12-30 8596
#> 8 2747-11-25 11:57:53 P/^ -1547 2352-08-18 2837
#> 9 34-04-08 11:10:52 5iBQ^@ 0 2095-01-18 404
#> 10 1040-09-06 11:02:55 |R 0 1202-07-30 -5476