diff options
Diffstat (limited to 'lisp/org/ob-R.el')
| -rw-r--r-- | lisp/org/ob-R.el | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/org/ob-R.el b/lisp/org/ob-R.el index 74d7513df3e..58f5536675c 100644 --- a/lisp/org/ob-R.el +++ b/lisp/org/ob-R.el | |||
| @@ -85,21 +85,22 @@ | |||
| 85 | (or graphics-file (org-babel-R-graphical-output-file params)))) | 85 | (or graphics-file (org-babel-R-graphical-output-file params)))) |
| 86 | (mapconcat | 86 | (mapconcat |
| 87 | #'identity | 87 | #'identity |
| 88 | ((lambda (inside) | 88 | (let ((inside |
| 89 | (if graphics-file | 89 | (append |
| 90 | (append | 90 | (when (cdr (assoc :prologue params)) |
| 91 | (list (org-babel-R-construct-graphics-device-call | 91 | (list (cdr (assoc :prologue params)))) |
| 92 | graphics-file params)) | 92 | (org-babel-variable-assignments:R params) |
| 93 | inside | 93 | (list body) |
| 94 | (list "dev.off()")) | 94 | (when (cdr (assoc :epilogue params)) |
| 95 | inside)) | 95 | (list (cdr (assoc :epilogue params))))))) |
| 96 | (append | 96 | (if graphics-file |
| 97 | (when (cdr (assoc :prologue params)) | 97 | (append |
| 98 | (list (cdr (assoc :prologue params)))) | 98 | (list (org-babel-R-construct-graphics-device-call |
| 99 | (org-babel-variable-assignments:R params) | 99 | graphics-file params)) |
| 100 | (list body) | 100 | inside |
| 101 | (when (cdr (assoc :epilogue params)) | 101 | (list "dev.off()")) |
| 102 | (list (cdr (assoc :epilogue params)))))) "\n"))) | 102 | inside)) |
| 103 | "\n"))) | ||
| 103 | 104 | ||
| 104 | (defun org-babel-execute:R (body params) | 105 | (defun org-babel-execute:R (body params) |
| 105 | "Execute a block of R code. | 106 | "Execute a block of R code. |
| @@ -324,6 +325,8 @@ last statement in BODY, as elisp." | |||
| 324 | column-names-p))) | 325 | column-names-p))) |
| 325 | (output (org-babel-eval org-babel-R-command body)))) | 326 | (output (org-babel-eval org-babel-R-command body)))) |
| 326 | 327 | ||
| 328 | (defvar ess-eval-visibly-p) | ||
| 329 | |||
| 327 | (defun org-babel-R-evaluate-session | 330 | (defun org-babel-R-evaluate-session |
| 328 | (session body result-type result-params column-names-p row-names-p) | 331 | (session body result-type result-params column-names-p row-names-p) |
| 329 | "Evaluate BODY in SESSION. | 332 | "Evaluate BODY in SESSION. |