View source: R/data_manip_utils.R
sprintf_single_value | R Documentation |
sprintf()
but using the same value in each specificationThis is equivalent to calling sprintf()
with value
passed after
fmt
as many times as there are conversion specifications in
fmt
.
sprintf_single_value(fmt, value)
fmt |
This has the same meaning as in |
value |
The single value use for every conversion
specification in |
See sprintf()
.
Note that vector arguments are still recycled normally.
fmt <- "Hello %s. Your name is %s. Isn't it good to be named %s?" # With normal sprintf, you need to specify the right number of # arguments: name <- c("John Doe", "Jane Doe") sprintf(fmt, name, name, name) # Instead, this figures out the right number of times to pass it: sprintf_single_value(fmt, name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.