sub_fn_body_name: Substitute a symbol in a function body

View source: R/utilities.R

sub_fn_body_nameR Documentation

Substitute a symbol in a function body

Description

This function substitute all old_names with new_names in a function body, and drops all the attributes.

Usage

sub_fn_body_name(fn, old_name, new_name)

Arguments

fn

Function.

old_name

Character. Name that needs to be replaced.

new_name

Character. Replacement of the old name.

Value

A function.

See Also

body()

Examples


a <- function() self$x + self$y
a

sub_fn_body_name(a, "self", "this")


bandicoot documentation built on May 29, 2024, 8:01 a.m.