%s$% | R Documentation |
stri_sprintf
as a Binary OperatorProvides access to stri_sprintf
in form of a binary
operator in a way similar to Python's %
overloaded for strings.
Missing values and empty vectors are propagated as usual.
e1 %s$% e2
e1 %stri$% e2
e1 |
format strings, see |
e2 |
a list of atomic vectors to be passed to |
Vectorized over e1
and e2
.
e1 %s$% atomic_vector
is equivalent to
e1 %s$% list(atomic_vector)
.
Returns a character vector.
Marek Gagolewski and other contributors
The official online manual of stringi at https://stringi.gagolewski.com/
Gagolewski M., stringi: Fast and portable character string processing in R, Journal of Statistical Software 103(2), 2022, 1-59, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v103.i02")}
Other length:
stri_isempty()
,
stri_length()
,
stri_numbytes()
,
stri_pad_both()
,
stri_sprintf()
,
stri_width()
"value='%d'" %s$% 3
"value='%d'" %s$% 1:3
"%s='%d'" %s$% list("value", 3)
"%s='%d'" %s$% list("value", 1:3)
"%s='%d'" %s$% list(c("a", "b", "c"), 1)
"%s='%d'" %s$% list(c("a", "b", "c"), 1:3)
x <- c("abcd", "\u00DF\u00B5\U0001F970", "abcdef")
cat("[%6s]" %s$% x, sep="\n") # width used, not the number of bytes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.