forked from mirrors/org-mode
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.
This commit is contained in:
parent
d438fbfb1b
commit
da5128404a
|
@ -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)
|
(defun org-babel-R-assign-elisp (name value colnames-p rownames-p)
|
||||||
"Construct R code assigning the elisp VALUE to a variable named NAME."
|
"Construct R code assigning the elisp VALUE to a variable named NAME."
|
||||||
(if (listp value)
|
(if (listp value)
|
||||||
(let ((max (apply #'max (mapcar #'length (org-remove-if-not
|
(let* ((lengths (mapcar 'length (org-remove-if-not 'sequencep value)))
|
||||||
#'sequencep value))))
|
(max (if lengths (apply 'max lengths) 0))
|
||||||
(min (apply #'min (mapcar #'length (org-remove-if-not
|
(min (if lengths (apply 'min lengths) 0))
|
||||||
#'sequencep value))))
|
|
||||||
(transition-file (org-babel-temp-file "R-import-")))
|
(transition-file (org-babel-temp-file "R-import-")))
|
||||||
;; ensure VALUE has an orgtbl structure (depth of at least 2)
|
;; Ensure VALUE has an orgtbl structure (depth of at least 2).
|
||||||
(unless (listp (car value)) (setq value (list value)))
|
(unless (listp (car value)) (setq value (list value)))
|
||||||
(with-temp-file transition-file
|
(with-temp-file transition-file
|
||||||
(insert
|
(insert
|
||||||
|
|
Loading…
Reference in a new issue