as_name() converts symbols to character strings. The
conversion is deterministic. That is, the roundtrip symbol -> name
-> symbol always gets the same result.
as_name() when you need to transform a symbol to a string
to refer to an object by its name.
as_label() when you need to transform any kind of object to
a string to represent that object with a short description.
as_name() to gain
features in the future.
rlang::as_name() is the opposite of
base::as.name(). If you're writing base R code, we recommend
base::as.symbol() which is an alias of
follows a more modern terminology (R types instead of S modes).
A string or symbol, possibly wrapped in a quosure. If a string, the attributes are removed, if any.
A character vector of length 1.