help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

org-babel: how to evaluate code block with "alias" language?


From: North Year
Subject: org-babel: how to evaluate code block with "alias" language?
Date: Tue, 22 Nov 2022 15:29:02 -0500
User-agent: mu4e 1.8.11; emacs 28.2

suppose I want to evaluate the following code block in an org file:

#+begin_src r
data.frame(
    dog = rnorm(5),
    cat = rnorm(5)
)
#+end_src

then I will get the following error:
"org-babel-execute-src-block: No org-babel-execute function for r!"

I tried the following config in my init file, but they does not to work

#+begin_src emacs-lisp

(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

(add-to-list 'org-src-lang-modes '("r" . R))
#+end_src

and the following elisp

#+begin_src emacs-lisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((r . t)))
#+end_src

will yield error:
"failed to provide feature ‘ob-r’"

I know this problem is trivial to solve by simply replace "r" by "R".
However aliases are something expected to frequently happened and
can anyone has idea on how to make evaluating code blcok with "alias" language 
work?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]