如何更改 Textmate R-Bundle 以运行 JGR.app 而不是 R.app?
我发现 JGR (Java GUI for R) 比标准 R Gui 好得多,但我想使用 Textmate 运行它,因为它具有项目处理功能。
R 已经有一个 Textmate 包,但我无法让它与 JGR 一起运行。 (但是我对 Textmate 捆绑包的编程几乎一无所知...)
我尝试在“run Selection in R”命令中将“R”替换为“JGR”:
# input is selection or document
rawText="`cat`"
curDir=''
if [[ ${#TM_DIRECTORY} -gt 0 ]]; then
curDir="$TM_DIRECTORY"
fi
osascript -e 'on run(theCode)' \
-e 'tell application "R" to activate' \
-e 'if (item 2 of theCode) is not "" then tell application "R" to cmd "setwd('\''" & (item 2 of theCode) & "'\'')"' \
-e 'tell application "R" to cmd (item 1 of theCode)' \
-e 'end run' -- "$rawText" "$curDir"
但运气不好,这会导致以下错误:
119:120: syntax error: Expected end of line, etc. but found """. (-2741)
替换 R不过,.app 与 R64.app 的工作方式相同。
I find JGR (Java GUI for R) far better than the standard R Gui, but I would like to run it with Textmate, because of its project handling capabilities.
There's already a Textmate bundle for R, but I can't get it to run with JGR. (But then I know next to nothing about programming Textmate bundles...)
I tried replacing 'R' with 'JGR' in the 'run Selection in R' command:
# input is selection or document
rawText="`cat`"
curDir=''
if [[ ${#TM_DIRECTORY} -gt 0 ]]; then
curDir="$TM_DIRECTORY"
fi
osascript -e 'on run(theCode)' \
-e 'tell application "R" to activate' \
-e 'if (item 2 of theCode) is not "" then tell application "R" to cmd "setwd('\''" & (item 2 of theCode) & "'\'')"' \
-e 'tell application "R" to cmd (item 1 of theCode)' \
-e 'end run' -- "$rawText" "$curDir"
But with no luck, this results in the following error:
119:120: syntax error: Expected end of line, etc. but found """. (-2741)
Replacing R.app with R64.app in the same way works, though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论