是否有Rscript的Emacs模式?

Fra*_*ank 6 emacs r ess

有没有可用的emacs模式Rscript

(RscriptR语言的脚本前端.)

如果我输入:

#!/usr/bin/Rscript
print(commandArgs(TRUE))
Run Code Online (Sandbox Code Playgroud)

并且indentESS R模式下,它会像疯了一样缩进第一行,因为它将其视为注释:

                          #!/usr/bin/Rscript
print(commandArgs(TRUE))
Run Code Online (Sandbox Code Playgroud)

Dav*_*ith 1

没有,但您可以通过使文件的第二行如下所示强制 Rscript 进入 R 编辑模式:

# -*- mode: R -*-
Run Code Online (Sandbox Code Playgroud)

(更多信息请点击此处。)

  • 另外,如果你以 .R(我对普通 R 文件的选择)或 .r(我对较小的或 Rscript“脚本”的选择)结尾,模式往往会自动分配给它们。 (2认同)