]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-R.el
Add a new function `svg-embed'
[gnu-emacs] / lisp / org / ob-R.el
index 93d6fe284f5b5e6998431341b3b8668aef9e311b..eee9bed318a4a7c0138106a9d220b3b06d226e77 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ob-R.el --- org-babel functions for R code evaluation
 
-;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte
 ;;     Dan Davison
@@ -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