Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stri_dup

Duplicate Strings


Description

Duplicates each str(e1) string times(e2) times and concatenates the results.

Usage

stri_dup(str, times)

e1 %s*% e2

e1 %stri*% e2

Arguments

str, e1

a character vector of strings to be duplicated

times, e2

an integer vector with the numbers of times to duplicate each string

Details

Vectorized over all arguments.

e1 %s*% e2 and e1 %stri*% e2 are synonyms for stri_dup(e1, e2)

Value

Returns a character vector.

See Also

Other join: %s+%(), stri_flatten(), stri_join_list(), stri_join()

Examples

stri_dup('a', 1:5)
stri_dup(c('a', NA, 'ba'), 4)
stri_dup(c('abc', 'pqrst'), c(4, 2))
"a" %s*% 5

stringi

Character String Processing Facilities

v1.6.1
file LICENSE
Authors
Marek Gagolewski [aut, cre, cph] (<https://orcid.org/0000-0003-0637-6028>), Bartek Tartanus [ctb], and others (stringi source code); IBM, Unicode, Inc. and others (ICU4C source code, Unicode Character Database)
Initial release
2021-05-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.