Construct data frame generators in a similar way to base::data.frame
.
Usage
data_frame_(..., 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
data_frame_(a = integer_()) %>% show_example()
#> a
#> 1 9671
#> 2 4660
#> 3 3371
#> 4 7003
#> 5 -8117
#> 6 -3130
#> 7 0
data_frame_(a = integer_(), b = character_(), rows = 5L) %>% show_example()
#> a b
#> 1 -7938 Mc8W
#> 2 8649 k|P@vvH
#> 3 8944 SGw'
#> 4 3072 mgVY'
#> 5 0 bM