我将R安装在名为"X:\alphaAndOmega\R\R“的目录中。因此Rterm.exe (32位版本)位于"X:\alphaAndOmega\R\R\bin\i386“。我知道它不是一个“标准的R目录”,像R-3.0.0这样的“标准R目录”很容易被ESS识别(至少如果我把它们添加到Windows的PATH变量中)。
我试着以某种方式定制我的.emacs文件,让ESS在我的非标准目录中查找Rterm.exe,但是我不能这样做。我完全是emacs的新手,我尝试过使用下面的一些命令:
inferior-R-program-name和ess-rterm-version-paths
但我失败了。埃斯什么都没找到。
我使用的是emacs 24.3.1、ESS 13.05和R 2.15。目前,我的.emacs文件只包含一行,所以这应该不是问题:
(require 'ess-site)
我可以做些什么来让ESS找到我的Rterm.exe?
发布于 2013-06-01 01:06:12
在ess-site.el中实际上只有一个配置设置;我以前使用过这个配置设置。这是来自ess-site.el的代码,但请注意,它已被注释掉:
;; If you wish to call other versions of R on a Unix system, ESS
;; should auto-detect other versions of R, according to matches to the
;; variable `ess-r-versions' as described in its docstring. Consider
;; changing that variable rather than changing inferior-R-program-name
;; if your version of R is not already auto-detected.
;;(setq-default inferior-R-program-name "R") ; unix systems
;;(setq-default inferior-R-program-name "Rterm") ; MS Windows, see below for path
;;(setq-default inferior-R-program-name "C:\\Program Files\\R\\R-2.5.0\\bin\\Rterm.exe")我刚刚在我的工作机器上检查了一下,默认情况下从$PATH中找到了Rterm.exe。我确实使用了Emacs/ESS/AucTeX bundle by Vincent Goulet,我可以全心全意地推荐它,因为“它就是工作”。
发布于 2013-06-01 01:21:01
要将ESS指向非标准R目录,请设置变量ess-directory-containing-R。(这个方便的变量是一个相对较新的特性。)引用the ESS manual
12.09中的
更改/新功能:
在Windows上,现在有了一个新的可定制变量(当前称为ESS -directory-containing R)来告诉ESS在哪里寻找Rterm.exe可执行文件。变量的名称和它可以接受的值都是beta版本,可能会更改。在此变量之前,ESS仅在默认安装目录中搜索。现在设置这个变量告诉ESS,当Rterm.exe可执行文件安装在其他地方时,如何查找它们。
如果我没记错的话,这需要在加载ess-site.el之前完成;无论如何,这就是我的.emacs文件中的内容,它可以很好地查找我所有的R版本,这些版本都存储在"C:/R/"下
(setq ess-directory-containing-R "c:")
;; Add to list of prefixes recognized by ESS.
;; Matching versions will appear after doing M-x R <TAB> <TAB>
(setq ess-r-versions '("R-1" "R-2" "R-3" "R-current" "R-devel" "R-patched"))
(load "C:/Program Files/GNU Emacs 23.3/site-lisp/ess/lisp/ess-site.el")
;; Set default R version, (i.e. the one launched by typing M-x R <RET>)
(setq inferior-R-program-name "c:/R/R-current/bin/i386/Rterm.exe")发布于 2016-07-05 23:05:52
当我遇到这个问题时,设置ess-directory- Setting R变量不起作用。此外,当我在另一台机器上执行“描述变量”时,在另一台机器上有一个正常工作的ess-emacs,值是零,所以我不认为这是正确的。
真正起作用的是将Windows环境中的PATH变量设置为指向Rterm.exe所在的目录,然后重新启动emacs。
https://stackoverflow.com/questions/16860694
复制相似问题