| evaluate_variable_arguments | R Documentation |
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
)
arg_expr |
Unevaluated expression (from match.call() or substitute()) |
arg_name |
Character string. Name of the argument (for error messages) |
data |
Optional data frame to look up columns |
calling_env |
Environment to evaluate symbols if data is NULL |
func_name |
Character string. Name of calling function (for error messages) |
allow_null |
Logical. If TRUE, NULL is a valid input. Default 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.