Vectorised over string
and times
.
str_dup(string, times)
string | Input character vector. |
---|---|
times | Number of times to duplicate each string. |
A character vector.
#> [1] "appleapple" "pearpear" "bananabanana"str_dup(fruit, 1:3)#> [1] "apple" "pearpear" "bananabananabanana"#> [1] "ba" "bana" "banana" "bananana" "banananana" #> [6] "bananananana"