I have been using R in the terminal window for Ubuntu. Recently I discovered the fix function in R, which I could use to edit my function. However, whenever I use the fix function, it opens up an editor (VIM) and I can use that to write my function. Then I type “wq” to save the work, however when I type the name of the function, it shows that there weren’t any edits which were made to the function. Why does this happen?
I have been using R in the terminal window for Ubuntu. Recently I discovered
Share
In order to use the editing functionality, make sure you have either
the default editor installed (do eg
grep EDITOR /etc/R/Renviron)or set the
EDITORenvironment variable to a different editor you prefer,or at runtime set
options("editor"=....)to what you need.Now, for the
fix()function in particular, note this hint in its manual page:So if the change “vanishes”, maybe you were editing an object which is not yours. Start with something simple, edit it and see if that persists. Along the lines of