[英]Change the R version opened by Sublime Text 2 - in Windows
我的問題是我想從ST2使用R 3.0.2運行R腳本。
安裝ST2時,我使用增強型R軟件包對其進行了配置,以便能夠從ST2運行R腳本。 使用R 2.15.2完成連接。 現在,我想從ST2自動運行R 3.0.2。 我沒有設法通過嘗試修改首選項>程序包設置>增強型R> Sublime Text 2中建議的設置默認值來使它起作用, 並且R是設置用戶中的修改腳本:
"default_extend_env": {"PATH": "{PATH};C:\\Program Files\\R\\R-3.0.2\\bin\\i386"}
以及默認設置的腳本(我復制了所有腳本,但使用Windows):
"osx" : {
// R / R64 / Terminal / iTerm
"App" : "R"
// path to Rscript binary
// "Rscript" : "/usr/bin/Rscript",
},
"windows" : {
// R32 / R64
"App" : "R64"
// path to R binary
// "R32" : "C:\\Program Files\\R\\R-3.0.2\\bin\\i386\\Rgui.exe",
// "R64" : "C:\\Program Files\\R\\R-3.0.2\\bin\\x64\\Rgui.exe",
// path to Rscript binary
// "Rscript" : "C:\\Program Files\\R\\R-3.0.2\\bin\\x64\\Rscript.exe",
},
"linux": {
// tmux / screen
"App" : "tmux"
// path
// "tmux" : "tmux",
// "screen" : "screen",
// path to Rscript binary
// "Rscript" : "",
},
// auto advance lines after sending command
"r_auto_advance": true,
// auto completions
"r_auto_completions": true,
// a list of packages which functions will show in the status bar
// "default_pkgs": ["base", "graphics", "grDevices", "methods", "stats", "utils"],
// a list of extensions
"extensions": ["r", "R", "s", "S", ".Rprofile"]
// Allows for '.' in R object names
// "word_separators": "/\\()\"‘-:,;~!@#$%^&*|+=[]{}`~?"
有人可以幫助我找到實現的方法嗎? 謝謝
打開Preferences -> Package Settings -> Enhanced R -> Settings-User
,並將其內容替換為以下內容:
{
"windows" : {
// R32 / R64
"App" : "R64",
// path to R binary
// "R32" : "C:\\Program Files\\R\\R-3.0.2\\bin\\i386\\Rgui.exe",
"R64" : "C:\\Program Files\\R\\R-3.0.2\\bin\\x64\\Rgui.exe",
// path to Rscript binary
"Rscript" : "C:\\Program Files\\R\\R-3.0.2\\bin\\x64\\Rscript.exe"
},
// auto advance lines after sending command
"r_auto_advance": true,
// auto completions
"r_auto_completions": true,
// a list of packages which functions will show in the status bar
// "default_pkgs": ["base", "graphics", "grDevices", "methods", "stats", "utils"],
// a list of extensions
"extensions": ["r", "R", "s", "S", ".Rprofile"],
// Allows for '.' in R object names
"word_separators": "/\\()\"‘-:,;~!@#$%^&*|+=[]{}`~?"
}
您將需要確保Rgui.exe
和Rscript.exe
二進制文件的路徑正確。 請注意,這是在使用64位R的64位系統上。如果在32位系統上,請使用以下代碼:
{
"windows" : {
// R32 / R64
"App" : "R32",
// path to R binary
"R32" : "C:\\Program Files\\R\\R-3.0.2\\bin\\i386\\Rgui.exe",
// "R64" : "C:\\Program Files\\R\\R-3.0.2\\bin\\x64\\Rgui.exe",
// path to Rscript binary
"Rscript" : "C:\\Program Files\\R\\R-3.0.2\\bin\\i386\\Rscript.exe"
},
// auto advance lines after sending command
"r_auto_advance": true,
// auto completions
"r_auto_completions": true,
// a list of packages which functions will show in the status bar
// "default_pkgs": ["base", "graphics", "grDevices", "methods", "stats", "utils"],
// a list of extensions
"extensions": ["r", "R", "s", "S", ".Rprofile"],
// Allows for '.' in R object names
"word_separators": "/\\()\"‘-:,;~!@#$%^&*|+=[]{}`~?"
}
保存文件,重新啟動Sublime,祝您好運,您應該已經准備就緒。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.