更正式的运算符保存对函数的更改:
function_I_want_to_edit <- edit()
这将打开编辑窗口,我可以在重新打开它时进行更改。
但是,如果我尝试一下:
edit(function_I_want_to_edit)
它打开编辑窗口,但当我重新打开它时,它似乎没有保存我的更改。这是在 RStudio 中,新更新到版本 3.2.2。
我不知道它是否总是这样工作,因为我相信我能够改变一件事,然后它就停止工作了。
有人注意到 edit
或 fix
存在类似问题吗?
最佳答案
是的,这似乎是预期的行为。如果您查看编辑
的帮助:
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
确实保存了我对函数所做的更改。
关于r - 新更新的 R 3.2.2 中编辑不保存功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32641613/