Applies glue::glue() to each element of a character vector using a template
string, enabling pipe-friendly, element-wise interpolation. Useful when the
vector to process is not encapsulated in a data.frame or other
environment-like object.
The glue::glue() and glue::glue_data() functions are also re-exported
for convenience
glue_vector(
.,
template = "{.}",
...,
.sep = "",
.envir = parent.frame(),
.open = "{",
.close = "}",
.na = "NA",
.null = character(),
.comment = "#",
.literal = FALSE,
.transformer = glue::identity_transformer,
.trim = TRUE
)A character vector with interpolated values. The length is determined by tidyverse recycling rules for all referenced variables.
A character vector to be interpolated.
A glue template string. Use {.} to refer to the default
(unnamed) vector variable, or the names of any other variables accessible
in the relevant environment. Variables are recycled using tidyverse
recycling rules.
Reserved and should not be used.
Arguments passed on to glue::glue(). Must be passed by name.
See glue::glue() for details.
letters |> glue_vector("Letters include {.} and {LETTERS}")
Run the code above in your browser using DataLab