Construct tibble generators in a similar way to tibble::tibble
.
Usage
tibble_(..., rows = c(1L, 10L))
Arguments
- ...
A set of name-value pairs with the values being vector 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)
.
Examples
tibble_(a = integer_()) %>% show_example()
#> # A tibble: 9 × 1
#> a
#> <int>
#> 1 6916
#> 2 -6596
#> 3 5686
#> 4 -7209
#> 5 1235
#> 6 4013
#> 7 -6390
#> 8 -7864
#> 9 2139
tibble_(a = integer_(), b = character_(), rows = 5L) %>% show_example()
#> # A tibble: 5 × 2
#> a b
#> <int> <chr>
#> 1 -2302 )Bk9
#> 2 5849 :+eKKA
#> 3 -6166 i dwHiHU
#> 4 2462 tHxNX
#> 5 -5884 }