to_symbol

Convert a string to a Symbol

Creates a Symbol from a string so it can be injected into quoted code with !!. Existing Symbol values pass through unchanged.

Parameters

Returns

The resulting symbol.

Examples

to_symbol("mpg")
to_expr(select(df, !!to_symbol("mpg")))