sub_fn_body_name {bandicoot}R 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")


[Package bandicoot version 1.0.0 Index]