%PDF- %PDF-
Direktori : /usr/local/share/emacs/27.2/lisp/org/ |
Current File : //usr/local/share/emacs/27.2/lisp/org/ob-R.elc |
;ELC ;;; Compiled ;;; in Emacs version 27.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\207" [require cl-lib ob] 2) #@30 R-specific header arguments. (defconst org-babel-header-args:R '((width . :any) (height . :any) (bg . :any) (units . :any) (pointsize . :any) (antialias . :any) (quality . :any) (compression . :any) (res . :any) (type . :any) (family . :any) (title . :any) (fonts . :any) (version . :any) (paper . :any) (encoding . :any) (pagecentre . :any) (colormodel . :any) (useDingbats . :any) (horizontal . :any) (results (file list vector table scalar verbatim) (raw html latex org code pp drawer) (replace silent none append prepend) (output value graphics))) (#$ . 471)) #@132 Header args which are safe for R babel blocks. See `org-babel-safe-header-args' for documentation of the format of this variable. (defconst ob-R-safe-header-args (append org-babel-safe-header-args '(:width :height :bg :units :pointsize :antialias :quality :compression :res :type :family :title :fonts :version :paper :encoding :pagecentre :colormodel :useDingbats :horizontal)) (#$ . 1042)) (defvar org-babel-default-header-args:R nil) (byte-code "\300\301\302\303#\210\304\305\306\307\310DD\311\312\313\314\315\316\317& \207" [put org-babel-default-header-args:R safe-local-variable #[257 "\211<\205 \300\301\"\207" [cl-every #[257 "\211:\205 \301\"\207" [ob-R-safe-header-args org-babel-one-header-arg-safe-p] 4 "\n\n(fn PAIR)"]] 4 "\n\n(fn VALUE)"] custom-declare-variable org-babel-R-command funcall function #[0 "\300\207" [#1="R --slave --no-save"] 1 #1#] "Name of command to use for executing R code." :group org-babel :version "24.1" :type string] 10) #@13 (fn INFO) (defalias 'org-babel-edit-prep:R #[257 "\300\3018\236A\211\205 \302\303\"\205 \304\303\"\205 \305\306\"\207" [:session 2 string-prefix-p "*" string-suffix-p org-babel-R-initiate-session nil] 5 (#$ . 2015)]) #@127 R code used to transfer a table defined as a variable from org to R. This function is used when the table contains a header. (defconst ob-R-transfer-variable-table-with-header "%s <- local({\n con <- textConnection(\n %S\n )\n res <- utils::read.table(\n con,\n header = %s,\n row.names = %s,\n sep = \"\\t\",\n as.is = TRUE\n )\n close(con)\n res\n })" (#$ . 2248)) #@135 R code used to transfer a table defined as a variable from org to R. This function is used when the table does not contain a header. (defconst ob-R-transfer-variable-table-without-header "%s <- local({\n con <- textConnection(\n %S\n )\n res <- utils::read.table(\n con,\n header = %s,\n row.names = %s,\n sep = \"\\t\",\n as.is = TRUE,\n fill = TRUE,\n col.names = paste(\"V\", seq_len(%d), sep =\"\")\n )\n close(con)\n res\n })" (#$ . 2698)) #@102 Expand BODY according to PARAMS, return the expanded body. (fn BODY PARAMS &optional GRAPHICS-FILE) (defalias 'org-babel-expand-body:R #[770 "\300\301\302\303\236A\205 \303\236AC\304!C\305\236A\205$ \305\236AC$\306#\207" [mapconcat identity append :prologue org-babel-variable-assignments:R :epilogue "\n"] 11 (#$ . 3243)]) #@104 Execute a block of R code. This function is called by `org-babel-execute-src-block'. (fn BODY PARAMS) (defalias 'org-babel-execute:R #[514 "\212\300\236A\301\236A\302\303\236A\"\304\300\236\235\205 \305!\211?\205$ \306\236A?\205. \307\236A\310#C\311\312\203K \313\314\f\"C\315C#\202L \316#\262\317\n\320\232\206g \321\322\236A \"\320\232\206w \321\323\236A \"&?\205 \211\266\210)\207" [:result-params :result-type org-babel-R-initiate-session :session "graphics" org-babel-graphical-output-file :colnames :rownames org-babel-expand-body:R mapconcat identity append org-babel-R-construct-graphics-device-call "},error=function(e){plot(x=-1:1, y=-1:1, type='n', xlab='', ylab='', axes=FALSE); text(x=0, y=0, labels=e$message, col='red'); paste('ERROR', e$message, sep=' : ')}); dev.off()" "\n" org-babel-R-evaluate "yes" org-babel-pick-name :colname-names :rowname-names] 18 (#$ . 3586)]) #@93 Prepare SESSION according to the header arguments specified in PARAMS. (fn SESSION PARAMS) (defalias 'org-babel-prep-session:R #[514 "\301\"\302!\303!\204 \304\305\"\210\306 \307\310\311\312\313!\314\"\315$\216rq\210\212\316\317\307\320\321\312\313!\322\"\323\324%\"\210,\210\207" [comint-input-filter org-babel-R-initiate-session org-babel-variable-assignments:R org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 #[257 "\300\207" [nil] 2 "\n\n(fn INPUT)"] mapc 257 "\301\210\211c\210\302\303\304\"\210\305\300!\207" [1 comint-send-input nil t org-babel-comint-wait-for-output] 4 "\n\n(fn VAR)"] 12 (#$ . 4521)]) #@51 Load BODY into SESSION. (fn SESSION BODY PARAMS) (defalias 'org-babel-load-session:R #[771 "\300 \301\302\303\304\305!\306\"\307$\216\310\"r\211q\210\311\312p!!b\210\313!c\210)\211\262)\207" [current-window-configuration make-byte-code 0 "\301\300!\207" vconcat vector [set-window-configuration] 2 org-babel-prep-session:R process-mark get-buffer-process org-babel-chomp] 10 (#$ . 5279)]) #@75 Return list of R statements assigning the block's variables. (fn PARAMS) (defalias 'org-babel-variable-assignments:R #[257 "\300!\301\302\303\304\305\306!\307\"\310\311%\301\302\303\312\305\306 \"\313\"\314\315%\316\317GS\"\"\"\207" [org-babel--get-vars mapcar make-byte-code 257 "\301@A\302\300\236A\303\232\304\300\236A\303\232$\207" vconcat vector [org-babel-R-assign-elisp :colnames "yes" :rownames] 7 "\n\n(fn PAIR)" "\211\3018@\302\3018A\303\300\236A8A\304\300\236A8A#B\207" [org-babel-reassemble-table :colname-names :rowname-names] 8 "\n\n(fn I)" number-sequence 0] 12 (#$ . 5680)]) #@40 Quote field S for export to R. (fn S) (defalias 'org-babel-R-quote-tsv-field #[257 "\211;\203 \300\301\302\303\300\"\304#\300Q\207\305\306\"\207" ["\"" mapconcat identity split-string "\"\"" format "%S"] 7 (#$ . 6291)]) #@109 Construct R code assigning the elisp VALUE to a variable named NAME. (fn NAME VALUE COLNAMES-P ROWNAMES-P) (defalias 'org-babel-R-assign-elisp #[1028 "<\203n \303\304\305\306\"\"\211\203 \307\310\"\202 \311\203$ \307\312\"\202% \311@<\204/ C\262\313\314\"A@\315=\204A \203E \316\202F \317\203N \320\202O \321U\203` \322%\202k \322 \n&\266\203\207\250\203~ \322\323\324!\325P#\207\326!\203\212 \322\323#\207;\203\260 \322\327\330\211\203\243 \331\311G\n$\210\202\253 \332\311G\330$\210\266\202#\207\322\327\333!#\207" [ob-R-transfer-variable-table-with-header ob-R-transfer-variable-table-without-header org-rm-props mapcar length cl-remove-if-not sequencep apply max 0 min orgtbl-to-tsv (:fmt org-babel-R-quote-tsv-field) hline "TRUE" "FALSE" "1" "NULL" format "%s <- %s" number-to-string "L" floatp "%s <- %S" nil remove-text-properties set-text-properties prin1-to-string] 17 (#$ . 6522)]) #@75 If there is not a current R process then create one. (fn SESSION PARAMS) (defalias 'org-babel-R-initiate-session #[514 "\303\230?\205{ \206\f \304\305\300!\205 \205 \306\236A?\307!\203&