stri_dup: Duplicate Strings

Description Usage Arguments Details Value See Also Examples

Description

Duplicates each string times times. This is done by copying the contents of str at the end of str.

Usage

1
stri_dup(str, times)

Arguments

str

character vector of strings to be duplicated

times

integer vector with the numbers of times to duplicate each string

Details

Vectorized over str and times.

Value

Returns a character vector.

See Also

Other join: stri_c, stri_join, stri_paste; stri_flatten

Examples

1
2
3
stri_dup("a", 1:5)
stri_dup(c("a", NA, "ba"), 4)
stri_dup(c("abc", "pqrst"), c(4, 2))

Example output

[1] "a"     "aa"    "aaa"   "aaaa"  "aaaaa"
[1] "aaaa"     NA         "babababa"
[1] "abcabcabcabc" "pqrstpqrst"  

stringi documentation built on May 2, 2019, 4:54 p.m.