Modify functions in R using body, formals and environment methods Modify functions in R using body, formals and environment methods r r

Modify functions in R using body, formals and environment methods


You need to use alist:

formals(f) = alist(x =, y =)

alist constructs a list from its unevaluated arguments.