打開當我爲此在RStudio或RGUI:配置修復()和編輯()以在記事本++從R/RStudio
fix(SomeFunction)
(或使用edit()
)我可以看到在記事本功能的代碼。有沒有什麼辦法可以改變這種情況,以便在Notepad ++中打開代碼預覽而不是普通的舊記事本?同樣,有無論如何,我可以強制在Excel中打開View(SomeDataFrame)
?
打開當我爲此在RStudio或RGUI:配置修復()和編輯()以在記事本++從R/RStudio
fix(SomeFunction)
(或使用edit()
)我可以看到在記事本功能的代碼。有沒有什麼辦法可以改變這種情況,以便在Notepad ++中打開代碼預覽而不是普通的舊記事本?同樣,有無論如何,我可以強制在Excel中打開View(SomeDataFrame)
?
fix
和edit
函數調用"editor"
參數中定義的編輯器。
默認情況下,該參數設置爲getOption('editor')
,如edit function documentation中所示。通過了變化ř選項爲當前會話即
path <- "C:\\Program Files (x86)\\Notepad++\\Notepad++.exe"
fix(somefunction,editor=path)
或設置記事本++作爲默認編輯器:
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)
因此,既可以通過記事本++路徑作爲函數參數,即NB
如果你想設置的新選項,默認爲所有的下屆會議,你應該在RHome\etc
路徑編輯Rprofile.site
腳本解釋here。
如果您的計算機上有多個R用戶,最好配置.Rprofile而不是.Rprofile.site。 – Dason