From da5128404a0629980edd0694373499a79a65fdc6 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 21 May 2014 04:21:00 +0200 Subject: [PATCH] ob-R.el (org-babel-R-assign-elisp): Fix parsing of a one-dimensional value * ob-R.el (org-babel-R-assign-elisp): Fix parsing of a one-dimensional value. Thanks to Daniil Mirylenka for the fix. --- lisp/ob-R.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index 93d6fe284..b97fd912e 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