Generates equal length vectors contained in a list.
Usage
equal_length(..., len = c(1L, 10L))
Arguments
- ...
A set of named or unnamed vector generators.
- len
Length of the generated vectors. If
len
is a single number all vectors will have this length. Iflen
is a numeric vector of length 2 it will produce vectors with lengths between a minimum and maximum, inclusive. For examplelen = c(1L, 10L)
would produce vectors with lengths between 1 and 10. To produce empty vectors setlen = 0L
or a range likelen = c(0L, 10L)
.
Examples
equal_length(integer_(), double_()) %>% show_example()
#> [[1]]
#> [1] -5541 4009 -1901 -4378 -5408 -6933 -7584 8234 9746 9202
#>
#> [[2]]
#> [1] -744550933 -837064812 555631093 676863033 -656133271 965150806
#> [7] -531170647 410013591 0 169517562
#>
equal_length(a = logical_(), b = character_(), len = 5L) %>% show_example()
#> $a
#> [1] FALSE TRUE TRUE TRUE FALSE
#>
#> $b
#> [1] "Je" "5BR~Vpi" "Q" "lQ=~;0o" " c9f"
#>