Resolves bare symbols (unquoted names) or quoted strings to actual data,
either from a data frame or the calling environment. This enables both
plot_density(DV1, data=df) and plot_density("DV1", data=df)
to work identically.
evaluate_variable_arguments(
arg_expr,
arg_name = "arg",
data = NULL,
calling_env = parent.frame(),
func_name = "function",
allow_null = FALSE
)A list with:
value: The actual data (vector, formula, or NULL)
name: Clean name for labels (e.g., "DV1")
name_raw: Raw name for error messages (e.g., "df$DV1")
was_symbol: Logical. TRUE if input was an unquoted name
Unevaluated expression (from match.call() or substitute())
Character string. Name of the argument (for error messages)
Optional data frame to look up columns
Environment to evaluate symbols if data is NULL
Character string. Name of calling function (for error messages)
Logical. If TRUE, NULL is a valid input. Default FALSE.