A set of generators for character vectors.
Arguments
- 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)
.- any_na
Whether
NA
values should be allowed.- any_empty
Whether empty character values should be allowed.
Examples
character_() %>% show_example()
#> [1] "8]^E*x" "whP" "x" "bv" "h`~" "O" "Z4$:"
character_(len = 10L, any_na = TRUE) %>% show_example()
#> [1] "hQ" "0&.<" "{^" "|V\\qgO`" "'!sUh4-" NA
#> [7] NA "uGx2~" NA NA
character_(len = 10L, any_empty = TRUE) %>% show_example()
#> [1] "" "" "+" "[(??n" "-qhP78" ""
#> [7] "~Feh" "!#Jw:d~K" "" "zC"