powered by
This function substitute all old_names with new_names in a function body, and drops all the attributes.
old_names
new_names
sub_fn_body_name(fn, old_name, new_name)
A function.
Function.
Character. Name that needs to be replaced.
Character. Replacement of the old name.
body()
a <- function() self$x + self$y a sub_fn_body_name(a, "self", "this")
Run the code above in your browser using DataLab