How can I use Emacs ESS mode with R markdown?

前端 未结 3 1454
既然无缘
既然无缘 2021-01-30 04:59

Is there a way to configure Emacs so that it recognizes (and allows execution of) R code chunks within R markdown (.Rmd) files similar to the way it recognizes code chunks in .R

3条回答
  •  佛祖请我去吃肉
    2021-01-30 06:00

    The other answers are rather outdated, and polymode now provides a specialized package for working with .Rmd files. Simply use the poly-R package from MELPA which has its source here on Github.

    The following may be added to your init.el or where-ever you use use-package:

    (use-package poly-R
      :ensure t
      :pin melpa-stable)
    

    For a more detailed use-case involving modifying the default keymaps see this configuration. The documentation describes the default keymaps.

提交回复
热议问题