Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 157
4.6.4 Changing Functions
ОглавлениеUsually,we will keep functions in a separate file that is then loaded in our code with the command source()
. Editing a function is then done by changing this file and reloading it – and hence overwriting the existing function content.
Most probably you will work in a modern environment such as the IDE RStudio,which makes editing a text-file with code and running that code a breeze. However, there might be cases where one has only terminal access to R. In that case, the following functions might come in handy.
edit()
fix()
# Edit the function with vi: fix(c_surface) # Or us edit: c_surface <- edit()