stringr::str_dup("hat", 3)[1] "hathathat"
Duplicates a string a designated number of times.
Duplicate the string “hat” 3 times.
A separator can be included.
This can be carried out with a vector.
[1] "rose,rose" "thistle,thistle" "leek,leek"
[4] "shamrock,shamrock"
With a vector you can duplicate the different elements to differing amounts.