Emacs-符号';s函数定义无效:R

Emacs-符号';s函数定义无效:R,r,emacs,ess,R,Emacs,Ess,我已使用以下命令在MacOSx中安装了emacs和ess: sudo port install ess +emacs_app 但当我尝试在组织模式下用C-C-C在代码块下运行时: #+begin_src R :results output :session :exports both summary(mtcars) #+end_src 它返回一个错误: Symbol's function definition is void: R 但我可以在shell模式下运行R,这意味着R已经在我的路径

我已使用以下命令在MacOSx中安装了emacs和ess:

sudo port install ess +emacs_app
但当我尝试在组织模式下用C-C-C在代码块下运行时:

#+begin_src R :results output :session :exports both
summary(mtcars)
#+end_src
它返回一个错误:

Symbol's function definition is void: R

但我可以在shell模式下运行R,这意味着R已经在我的路径中,为什么它仍然报告此错误?

您已经安装了ess软件包,但需要在emacs init文件(~/.emacs/init.el)中使用以下命令加载ess库:


有关更多详细信息,请参阅

错误消息告诉您没有定义名为
R
的Emacs函数。这可能意味着尚未加载定义该函数的Emacs库。
(require 'ess-site)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))