Using R in Emacs

Source: Internet
Author: User

Required Plugins
    • Http://ess.r-project.org/index.php?Section=home
    • Download the previous URL installation package and install, after installation, ESS is generally installed under/usr/share/emacs/site-lisp/ess, of course, you can also use the command sudo find/-type f-name "Ess.el" to find the installation directory of ESS
Emacs Configuration

Add in an. emacs file

(add-to-list ' load-path "/usr/share/emacs/site-lisp/ess")(require ' Ess-site);; Optional configuration;; Set up the working directory for ESS(setq ess-ask-for-ess-directory nil)(setq ess-set-working-directory "~/r/");; Setting the default language;;( SETQ ess-ask-for-dialect Nil)(setq ess-dialect "R")(add-to-list ' auto-mode-alist ' ("\ \. R $ " . R-mode))(add-to-list ' auto-mode-alist ' ("\\.r$" ). R-mode))(setq ess-local-process-name "R")(setq ansi-color-for-comint-mode ' filter)(setq comint-prompt-read-only t)(setq comint-scroll-to-bottom-on-input t)(setq comint-scroll-to-bottom-on-output t)(setq comint-move-point-for-output t)(global-set-key [(meta i)] ' Ess-eval-line)(global-set-key [(meta o)] ' ess-eval-region)(global-set-key [(meta p)] ' Ess-eval-buffer)
Common commands
    • M-x ess-eval-line: Code to run the current line
    • M-x ess-eval-region: When you select region by cursor, the command is executed and the code currently selected is run
    • M-x Ess-eval-buffer: Code to run the current buffer
    • There are also many commands that can be queried for documents, or you can press the TAB key after entering M-x ESS. Of course, you can set the global shortcut keys, faster execution of commands.
    • In addition, ESS supports a variety of statistical languages such as R, Stata.
ESS reference Documentation

Official Document Link: http://ess.r-project.org/ess.pdf

Using R in Emacs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.