wrap {yasp} | R Documentation |
Wrap strings
Description
Wrap strings with flanking characters
Usage
wrap(x, left, right = left)
dbl_quote(..., sep = "")
sngl_quote(..., sep = "")
bracket(..., sep = "")
brace(..., sep = "")
parens(..., sep = "")
Arguments
x |
character to wrap |
left , right |
character pair to wrap with |
sep , ... |
passed to |
See Also
Examples
wrap("abc", "__") # __abc__
parens("abc") # (abc)
sngl_quote("abc") # 'abc'
dbl_quote("abc") # "abc"
bracket("abc") # [abc]
brace("abc") # {abc}
label <- p("name", parens("attribute"))
label # "name (attribute)"
unparens(label) # "name attribute"
# make your own function like this:
# markdown bold
bold <- function(...) wrap(paste(...), "**")
p("make a word", bold("bold"))
# see unbold example in ?unwrap
[Package yasp version 0.2.0 Index]