These functions act as wrappers around rlang::abort() and rlang::warn() to allow the glue-style insertion of variables names. By default, object names are parsed via substitute(), rather than evaluated, meaning that the objects do not need to be coerced to strings. This is useful inside functions to grab the variable name passed by the user

glue_abort(msg, ..., sub = T)

glue_warn(msg, ..., sub = T)

Arguments

msg

Message to be passed as either an error or a warning

...

additional arguments to be passed to rlang::abort() or rlang::warn()

sub

should the substitute() function be wrapped around the elements of msg

Examples

f <- function(input_argument) { glue_abort("Error is with {input_argument}") } x <- "Show My Name, Not My String" if (FALSE) { f(x) f("Show Me") }