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.