-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
scimax-statistics.el
46 lines (37 loc) · 1.6 KB
/
scimax-statistics.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
;;; scimax-statistics.el --- Statistics and data science features for emacs
;;; Commentary:
;;
;;; Code:
(use-package ess)
(use-package ess-R-data-view)
(use-package ess-smart-equals)
(use-package ess-smart-underscore)
(use-package polymode)
;;; The following chunk is taken from: https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Blang/ess/packages.el
;;; Follow Hadley Wickham's R style guide
(setq ess-first-continued-statement-offset 2
ess-continued-statement-offset 0
ess-expression-offset 2
ess-nuke-trailing-whitespace-p t
ess-default-style 'DEFAULT)
;;; The following chunk is taken from antonio's answer from https://stackoverflow.com/questions/16172345/how-can-i-use-emacs-ess-mode-with-r-markdown
(defun rmd-mode ()
"ESS Markdown mode for rmd files."
(interactive)
(require 'poly-R)
(require 'poly-markdown)
(poly-markdown+r-mode))
;;; The following chunks are taken from https://github.com/vspinu/polymode
;;; MARKDOWN
(add-to-list 'auto-mode-alist '("\\.md" . poly-markdown-mode))
;;; R modes
(add-to-list 'auto-mode-alist '("\\.Snw$" . poly-noweb+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rnw$" . poly-noweb+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rmd$" . poly-markdown+r-mode))
(add-to-list 'auto-mode-alist '("\\.rapport$" . poly-rapport-mode))
(add-to-list 'auto-mode-alist '("\\.Rhtml$" . poly-html+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rbrew$" . poly-brew+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rcpp$" . poly-r+c++-mode))
(add-to-list 'auto-mode-alist '("\\.cppR$" . poly-c++r-mode))
(provide 'scimax-statistics)
;;; scimax-statistics.el ends here