Replace symbols in an expression
Usage
replace_symbol_in_expr(expression, target, replace)
Arguments
- expression
Expression
- Default value
none
- target
Target symbol
- Default value
none
- replace
Replacing symbol
- Default value
none
Value
The expression where every occurrence of the symbol target
is
replaced by replace
Examples
library(rlang)
replace_symbol_in_expr(expr(AVAL), target = AVAL, replace = AVAL.join)
#> AVAL.join
replace_symbol_in_expr(expr(AVALC), target = AVAL, replace = AVAL.join)
#> AVALC
replace_symbol_in_expr(expr(desc(AVAL)), target = AVAL, replace = AVAL.join)
#> desc(AVAL.join)