Wrap text in em dashes

ems(...)

Arguments

...

Character. Text to go between em dashes, and any other arguments to be passed to glue.

Value

Character. String surrounded in em dashes.

ems is a wrapper for glue, so you can use curly bracket notation and multiple character strings just like with glue.

Examples

ems("hello world")
#> —hello world—
ems("hello ", "world")
#> —hello world—
fname <- "Darth" lname <- "Vader" ems("hello there {fname} {lname}")
#> Error in eval(parse(text = text, keep.source = FALSE), envir): object 'fname' not found
ems( "hello {fname} {lname}, ", "I says to him" )
#> Error in eval(parse(text = text, keep.source = FALSE), envir): object 'fname' not found