Learn R Programming

glue (version 1.8.0)

as_glue: Coerce object to glue

Description

A glue object is a character vector with S3 class "glue". The "glue" class implements a print method that shows the literal contents (rather than the string implementation) and a + method, so that you can concatenate with the addition operator.

Usage

as_glue(x, ...)

Value

A character vector with S3 class "glue".

Arguments

x

object to be coerced.

...

further arguments passed to methods.

Examples

Run this code
x <- as_glue(c("abc", "\"\\\\", "\n"))
x

x <- 1
y <- 3
glue("x + y") + " = {x + y}"

Run the code above in your browser using DataLab