From 2b00d486185d2507ee5ee8d45d9a738debd8ab15 Mon Sep 17 00:00:00 2001 From: marc Date: Wed, 14 Mar 2018 10:56:46 +0100 Subject: [PATCH] babel R added, an example for plot added --- config.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/config.org b/config.org index c9492a6..0cbcbbe 100644 --- a/config.org +++ b/config.org @@ -1,6 +1,17 @@ #+TITLE: Emacs Configuration #+AUTHOR: Marc Pohling +Needs debian package ess +#+begin_src R :session *R* :results output graphics :file second.png :exports both +library(ggplot2) +x <- (0:100)/100 +y <- x^2 +qplot(x,y,geom="line",xlab=expression(x),ylab=expression(f(x)==x^2), + main="Quadratfunktion") +#+end_src + +#+RESULTS: + * Personal Information #+begin_src emacs-lisp @@ -240,6 +251,7 @@ The default value is -77, which is weird for smaller width windows. I'd rather h (java . t) (ruby . t) (lisp . t) + (R . t) (scheme . t) (shell . t) (sqlite . t) @@ -250,11 +262,21 @@ The default value is -77, which is weird for smaller width windows. I'd rather h (not (or (string= lang "C") (string= lang "java") (string= lang "python") + (string= lang "R") (string= lang "emacs-lisp") (string= lang "sqlite")))) (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate) #+end_src +I want plots! +#+begin_src emacs-lisp + (use-package ess + :ensure t + ) +(add-hook 'org-babel-after-execute-hook 'org-display-inline-images) +(add-hook 'org-mode-hook 'org-display-inline-images) +#+end_src + ** Org babel/source blocks I like to have source blocks properly syntax highlighted and with the editing popup window staying within the same window so all the windows don't jump around. Also, having the top and bottom trailing lines in the block is a waste of space, so we can remove them