编辑不保存新更新的 R 3.2.2 中的功能
Edit does not save function in newly updated R 3.2.2
比较正式的算子保存对函数的修改:
function_I_want_to_edit <- edit()
这会打开编辑 window 并且我可以进行更改,这些更改在我重新打开它时已经存在。
但是,如果我只是尝试:
edit(function_I_want_to_edit)
它打开编辑 window 但当我重新打开它时它似乎没有保存我的更改。这是在 RStudio 中,最新更新到版本 3.2.2。
我不知道它是否总是这样工作,因为我相信我能够改变一件事,然后它就停止工作了。
有没有人注意到 edit
或 fix
有类似的问题?
是的,这似乎是预期的行为。如果您查看 edit
:
的帮助
It is important to realize that edit
does not change the object called
name
. Instead, a copy of name
is made and it is that copy which is
changed. Should you want the changes to apply to the object name
you
must assign the result of edit
to name
. (Try fix
if you want to make
permanent changes to an object.)
fix
确实保存了我对函数所做的更改。
比较正式的算子保存对函数的修改:
function_I_want_to_edit <- edit()
这会打开编辑 window 并且我可以进行更改,这些更改在我重新打开它时已经存在。
但是,如果我只是尝试:
edit(function_I_want_to_edit)
它打开编辑 window 但当我重新打开它时它似乎没有保存我的更改。这是在 RStudio 中,最新更新到版本 3.2.2。
我不知道它是否总是这样工作,因为我相信我能够改变一件事,然后它就停止工作了。
有没有人注意到 edit
或 fix
有类似的问题?
是的,这似乎是预期的行为。如果您查看 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
确实保存了我对函数所做的更改。