Duplicate and concatenate strings within a character vector.
Vectorised over string
and times
.
str_dup(string, times)
string |
Input character vector. |
times |
Number of times to duplicate each string. |
A character vector.
fruit <- c("apple", "pear", "banana") str_dup(fruit, 2) str_dup(fruit, 1:3) str_c("ba", str_dup("na", 0:5))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.