1

我发现 JGR(Java GUI for R)比标准的 R Gui 好得多,但我想用 Textmate 运行它,因为它的项目处理能力。

R 已经有一个 Textmate 包,但我无法让它与 JGR 一起运行。(但后来我对 Textmate 捆绑包的编程几乎一无所知......)

我尝试在“在 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 是可行的。

4

0 回答 0