Configure fix() and edit() to open in Notepad++ from R/RStudio

只愿长相守 提交于 2019-12-05 07:35:01

fix and edit functions invoke the editor defined in the "editor" argument.
By default, that argument is set to getOption('editor') as shown in the edit function documentation.

Therefore, you can either pass the notepad++ path as function argument, i.e. :

path <- "C:\\Program Files (x86)\\Notepad++\\Notepad++.exe"
fix(somefunction,editor=path)

or set notepad++ as default editor by changin R options for the current session i.e. :

path <- "C:\\Program Files (x86)\\Notepad++\\Notepad++.exe"

options(editor=path)

# from now on, all calls to fix and edit will open notepad++ as default editor...
fix(somefunction)

N.B.

If you want to set the new option as the default for all the next sessions, you should edit Rprofile.site script in RHome\etc path as explained here.

You could try something like this to create a temporary .csv and open in Excel.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!