Is there any usable emacs mode for Rscript
?
(Rscript
is the script front-end for the R language.)
If I type this:
#!/usr/bin/Rscript
print(commandArgs(TRUE))
and do indent
in the ESS R-mode it indents the first line like crazy, since it sees it as a comment:
#!/usr/bin/Rscript
print(commandArgs(TRUE))
As of version 5.9, ESS will recognize scripts using the Rscript or litter interpreter; see http://ess.r-project.org/Manual/ess.html#New-features.
For reference, to assign a mode to an interpreter, use the interpreter-mode-alist variable. For example,
(add-to-list 'interpreter-mode-alist '("Rscript" . r-mode))
Any file with a first line like "#!/usr/bin/Rscript" will be recognized as r-mode.
There isn't, but you can force your Rscript into R editing mode by making the second line of the file look like this:
# -*- mode: R -*-
(More information here.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With