summaryrefslogtreecommitdiff
path: root/lisp/ob-R.el
diff options
context:
space:
mode:
authorSébastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:35 +0200
committerSébastien Delafond <sdelafond@gmail.com>2014-07-13 13:35:35 +0200
commit361fd4da7cfa870165cb1ec175cdbea55ca40e7e (patch)
treea36bfd91d9e14c354b6eaebb20f5d5d64ec438db /lisp/ob-R.el
parent77ddd382df838e38504b822e729250b2a6dd9b63 (diff)
Imported Upstream version 8.2.7a
Diffstat (limited to 'lisp/ob-R.el')
-rw-r--r--lisp/ob-R.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index 93d6fe2..b97fd91 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -173,12 +173,11 @@ This function is called by `org-babel-execute-src-block'."
(defun org-babel-R-assign-elisp (name value colnames-p rownames-p)
"Construct R code assigning the elisp VALUE to a variable named NAME."
(if (listp value)
- (let ((max (apply #'max (mapcar #'length (org-remove-if-not
- #'sequencep value))))
- (min (apply #'min (mapcar #'length (org-remove-if-not
- #'sequencep value))))
- (transition-file (org-babel-temp-file "R-import-")))
- ;; ensure VALUE has an orgtbl structure (depth of at least 2)
+ (let* ((lengths (mapcar 'length (org-remove-if-not 'sequencep value)))
+ (max (if lengths (apply 'max lengths) 0))
+ (min (if lengths (apply 'min lengths) 0))
+ (transition-file (org-babel-temp-file "R-import-")))
+ ;; Ensure VALUE has an orgtbl structure (depth of at least 2).
(unless (listp (car value)) (setq value (list value)))
(with-temp-file transition-file
(insert