powered by
Vectorised over string and times.
string
times
str_dup(string, times)
Input character vector.
Number of times to duplicate each string.
A character vector.
# NOT RUN { fruit <- c("apple", "pear", "banana") str_dup(fruit, 2) str_dup(fruit, 1:3) str_c("ba", str_dup("na", 0:5)) # }
Run the code above in your browser using DataLab