Reputation: 25
The more formal operator saves the changes to the function:
function_I_want_to_edit <- edit()
This opens the editing window and I can make changes which are there when I re-open it.
However, if I simply try:
edit(function_I_want_to_edit)
It opens the editing window but it does not appear to have saved my changes when I re-open it. This is in RStudio, newly updated to Version 3.2.2.
I can't tell if it always worked like this or not, because I believe I was able to change one thing, and then it stopped working.
Has anyone noticed a similar problem with edit
or fix
?
Upvotes: 2
Views: 2276
Reputation: 726
Yes, this appears to be the intended behavior. If you look at the help for edit
:
It is important to realize that
edit
does not change the object calledname
. Instead, a copy ofname
is made and it is that copy which is changed. Should you want the changes to apply to the objectname
you must assign the result ofedit
toname
. (Tryfix
if you want to make permanent changes to an object.)
fix
does save the changes I make to a function.
Upvotes: 3