format | R Documentation |
Substitutes the arguments into the argument str. See the examples below.
format(str, ..., context = "normal")
str |
the format string |
... |
the arguments to substitute into the string |
context |
'normal' or 'R' |
the resultant string
jmvcore::format('the {} was delish', 'fish')
# 'the fish was delish'
jmvcore::format('the {} was more delish than the {}', 'fish', 'cow')
# 'the fish was more delish than the cow'
jmvcore::format('the {1} was more delish than the {0}', 'fish', 'cow')
# 'the cow was more delish than the fish'
jmvcore::format('the {what} and the {which}', which='fish', what='cow')
# 'the cow and the fish'
jmvcore::format('that is simply not {}', TRUE)
# 'that is simply not true'
jmvcore::format('that is simply not {}', TRUE, context='R')
# 'that is simply not TRUE'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.