Learn R Programming

bandicoot (version 1.0.0)

sub_fn_body_name: 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)

Value

A function.

Arguments

fn

Function.

old_name

Character. Name that needs to be replaced.

new_name

Character. Replacement of the old name.

See Also

Examples

Run this code

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

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

Run the code above in your browser using DataLab