1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

Can't assume every entry in a table is a sequence

* lisp/ob-R.el (org-babel-R-assign-elisp): Can't assume every entry in
  a table is a sequence.
This commit is contained in:
Eric Schulte 2012-05-11 16:50:34 -04:00
parent 5750f0869c
commit eabc823bee

View File

@ -167,8 +167,10 @@ 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 value)))
(min (apply #'min (mapcar #'length 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)
(unless (listp (car value)) (setq value (list value)))