Learn R Programming

admiraldev (version 1.2.0)

replace_symbol_in_expr: Replace Symbols in an Expression

Description

Replace symbols in an expression

Usage

replace_symbol_in_expr(expression, target, replace)

Value

The expression where every occurrence of the symbol target is replaced by replace

Arguments

expression

Expression

target

Target symbol

replace

Replacing symbol

Author

Stefan Bundfuss

See Also

Helpers for working with Quosures: add_suffix_to_vars(), expr_c(), replace_values_by_names()

Examples

Run this code

library(rlang)

replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join)
replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join)
replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join)

Run the code above in your browser using DataLab