str_dup | R Documentation |
str_dup()
duplicates the characters within a string, e.g.
str_dup("xy", 3)
returns "xyxyxy"
.
str_dup(string, times)
string |
Input vector. Either a character vector, or something coercible to one. |
times |
Number of times to duplicate each string. |
A character vector the same length as string
/times
.
fruit <- c("apple", "pear", "banana")
str_dup(fruit, 2)
str_dup(fruit, 1:3)
str_c("ba", str_dup("na", 0:5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.