Function: org-babel-R-construct-graphics-device-call

org-babel-R-construct-graphics-device-call is a byte-compiled function defined in ob-R.el.gz.

Signature

(org-babel-R-construct-graphics-device-call OUT-FILE PARAMS)

Documentation

Construct the call to the graphics device.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-R.el.gz
(defun org-babel-R-construct-graphics-device-call (out-file params)
  "Construct the call to the graphics device."
  (let* ((allowed-args '(:width :height :bg :units :pointsize
				:antialias :quality :compression :res
				:type :family :title :fonts :version
				:paper :encoding :pagecentre :colormodel
				:useDingbats :horizontal))
	 (device (file-name-extension out-file))
	 (device-info (or (assq (intern (concat ":" device))
				org-babel-R-graphics-devices)
                          (assq :png org-babel-R-graphics-devices)))
         (extra-args (cdr (assq :R-dev-args params))) filearg args)
    (setq device (nth 1 device-info))
    (setq filearg (nth 2 device-info))
    (setq args (mapconcat
		(lambda (pair)
		  (if (member (car pair) allowed-args)
		      (format ",%s=%S"
			      (substring (symbol-name (car pair)) 1)
			      (cdr pair)) ""))
		params ""))
    (format "%s(%s=\"%s\"%s%s%s); tryCatch({"
	    device filearg out-file args
	    (if extra-args "," "") (or extra-args ""))))