quotes: Wrap text in curly quotes

Description Usage Arguments Value Examples

View source: R/symbols.R

Description

Wrap text in curly quotes

Usage

1
quotes(..., type = c("double", "single"), curly = TRUE)

Arguments

...

Character. Text to go between curly quotes, and any other arguments to be passed to glue.

type

Character. Type of quotes: "single" or "double".

curly

Logical. Set to FALSE for straight quotes.

Value

Character. String surrounded in quotation marks.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(glue)
quotes("hello world")
quotes("hello world", type = "single")
quotes("hello ", "world", type = "single")
fname <- glue("I{enye()}igo")
lname <- "Montoya"
quotes("hello, my name is {fname} {lname}", type = "single")
quotes(
  "Hello, my name is {fname} {lname}. ",
  "You killed my father. Prepare to die."
)
quotes(
  "Hello, my name is {fname} {lname}. ",
  "I'm boring, and I use straight quotes.",
  curly = FALSE
)

BenjaminWolfe/typewritr documentation built on Nov. 23, 2019, 11:18 a.m.