Server IP : 111.118.215.189 / Your IP : 18.117.158.174 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/share/emacs/24.3/lisp/org/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
;ELC ;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:06:38 2024 ;;; from file /builddir/build/BUILD/emacs-24.3/lisp/org/ob-R.el ;;; in Emacs version 24.3.1 ;;; 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!\210\300\303!\210\300\304!\207" [require ob ob-ref ob-comint ob-eval] 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 org html latex code pp wrap) (replace silent append prepend) (output value graphics))) (#$ . 658)) (defvar org-babel-default-header-args:R nil) #@46 Name of command to use for executing R code. (custom-declare-variable 'org-babel-R-command "R --slave --no-save" '(#$ . 1266) :group 'org-babel :version "24.1" :type 'string) (defalias 'org-babel-edit-prep:R #[(info) "\303\304\3058\"A\211\205 \306\307 \"\205 \310 \311\216\312 \313\"*)\207" [info session save-match-data-internal assoc :session 2 string-match "^\\*\\(.+?\\)\\*$" match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-babel-R-initiate-session nil] 5]) #@60 Expand BODY according to PARAMS, return the expanded body. (defalias 'org-babel-expand-body:R #[(body params &optional graphics-file) "\206 \304 !\305\306\307\310 !\nC\"\203# \307\311 \"C\312C#\202$ )\313#)\207" [graphics-file params body inside org-babel-R-graphical-output-file mapconcat identity append org-babel-variable-assignments:R org-babel-R-construct-graphics-device-call "dev.off()" "\n"] 6 (#$ . 1792)]) #@86 Execute a block of R code. This function is called by `org-babel-execute-src-block'. (defalias 'org-babel-execute:R #[(body params) "\212\306\307\"A\306\310\"A\311\306\312\"A\"\306\313\"A\306\314\"A\315!\316#\317\n \f\320\232\206D \321\306\322\"A\f\" \320\232\206R \321\306\323\"A \"&?\205^ . \207" [params result-params result-type session colnames-p rownames-p assoc :result-params :result-type org-babel-R-initiate-session :session :colnames :rownames org-babel-R-graphical-output-file org-babel-expand-body:R org-babel-R-evaluate "yes" org-babel-pick-name :colname-names :rowname-names graphics-file body full-body result] 10 (#$ . 2222)]) #@72 Prepare SESSION according to the header arguments specified in PARAMS. (defalias 'org-babel-prep-session:R #[(session params) "\304 \"\305 !\212\306 \307\216\310!\204 \311\312\"\210q\210\313\314\n\"\210+*\207" [session params var-lines save-match-data-internal org-babel-R-initiate-session org-babel-variable-assignments:R match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" mapc #[(var) "\302\210c\210\303\304\305\"\210\306 !\207" [var session 1 comint-send-input nil t org-babel-comint-wait-for-output] 3]] 3 (#$ . 2905)]) #@25 Load BODY into SESSION. (defalias 'org-babel-load-session:R #[(session body params) "\305 \306\216\307 \n\"rq\210\310\311p!!b\210\312\f!c\210)+\207" [#1=#:wconfig session params buffer body current-window-configuration ((set-window-configuration #1#)) org-babel-prep-session:R process-mark get-buffer-process org-babel-chomp] 3 (#$ . 3573)]) #@62 Return list of R statements assigning the block's variables. (defalias 'org-babel-variable-assignments:R #[(params) "\302\303\304\305\"\"\302\306\302\307\310\311 GS\"\"\")\207" [params vars mapcar cdr org-babel-get-header :var #[(pair) "\302@A\303\304 \"A\305\232\303\306 \"A\305\232$\207" [pair params org-babel-R-assign-elisp assoc :colnames "yes" :rownames] 7] #[(i) " 8@\303 8A\304\305\n\"A8A\304\306\n\"A8A#B\207" [i vars params org-babel-reassemble-table assoc :colname-names :rowname-names] 8] org-number-sequence 0] 7 (#$ . 3925)]) #@32 Quote field S for export to R. (defalias 'org-babel-R-quote-tsv-field #[(s) ";\203 \301\302\303\304\301\"\305#\301Q\207\306\307\"\207" [s "\"" mapconcat identity split-string "\"\"" format "%S"] 6 (#$ . 4479)]) #@70 Construct R code assigning the elisp VALUE to a variable named NAME. (defalias 'org-babel-R-assign-elisp #[(name value colnames-p rownames-p) "<\203\226 \306\303\307\310\311\312\"\"\"\306\302\307\310\311\312\"\"\"\313\314!@<\204( C \315\316\317!!\320\216r\fq\210\321\322\"\323\261\210)r\fq\210\324\325\211 \325\326%\210,\327 \330\"A@\331=\204] #\203a \332\202b \333$\203k \334\202l \335%&'\nU\203\206 \336\337('&%%\202\223 \336\340('&%&.\207\336\341(\342!#\207" [value transition-file min max #1=#:temp-buffer #2=#:temp-file apply mapcar length org-remove-if-not sequencep org-babel-temp-file "R-import-" get-buffer-create generate-new-buffer-name " *temp file*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) orgtbl-to-tsv (:fmt org-babel-R-quote-tsv-field) "\n" write-region nil 0 org-babel-process-file-name noquote hline "TRUE" "FALSE" "1" "NULL" format "%s <- read.table(\"%s\",\n header=%s,\n row.names=%s,\n sep=\"\\t\",\n as.is=TRUE)" "%s <- read.table(\"%s\",\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 =\"\"))" "%s <- %s" org-babel-R-quote-tsv-field colnames-p rownames-p row-names header file name] 8 (#$ . 4700)]) #@54 If there is not a current R process then create one. (defalias 'org-babel-R-initiate-session #[(session params) "\304\230?\205Q \206\f \305\306\301!\205 \205 \307\310\n\"A?\311!\203( \202P \312 \313\216\314\315!\210\316 \210\317\320!\203A \321!\202L ;\203J \202L \321 !\210p**\207" [session ess-ask-for-ess-directory params #1=#:wconfig "none" "*R*" boundp assoc :dir org-babel-comint-buffer-livep current-window-configuration ((set-window-configuration #1#)) require ess R rename-buffer bufferp buffer-name] 4 (#$ . 6162)]) #@126 Associate R code buffer with an R session. Make SESSION be the inferior ESS process associated with the current code buffer. (defalias 'org-babel-R-associate-session #[(session) "\302\303!!\304 \207" [session ess-local-process-name process-name get-buffer-process ess-make-buffer-current] 3 (#$ . 6708)]) #@55 Name of file to which R should send graphical output. (defalias 'org-babel-R-graphical-output-file #[(params) "\301\302\236A\235\205 \303\236A\207" [params "graphics" :result-params :file] 3 (#$ . 7021)]) #@44 Construct the call to the graphics device. (defalias 'org-babel-R-construct-graphics-device-call #[(out-file params) "\306\307\310\311\"\205 \312\313\"\314 \236A\315\211 \203+ \316\317 P!\236A\206, \320\211\321\235\2037 \322\2028 \323\324\325 \326#\327\330 \n\f\203M \331\202N \326\f\206S \326&.\207" [out-file params args filearg extra-args device ((:bmp . "bmp") (:jpg . "jpeg") (:jpeg . "jpeg") (:tex . "tikz") (:tiff . "tiff") (:png . "png") (:svg . "svg") (:pdf . "pdf") (:ps . "postscript") (:postscript . "postscript")) (:width :height :bg :units :pointsize :antialias :quality :compression :res :type :family :title :fonts :version :paper :encoding :pagecentre :colormodel :useDingbats :horizontal) string-match ".+\\.\\([^.]+\\)" match-string 1 :R-dev-args nil intern ":" "png" ("pdf" "postscript" "svg" "tikz") "file" "filename" mapconcat #[(pair) "@ \235\203 \302\303\304@!\305\306OA#\207\307\207" [pair allowed-args format ",%s=%S" symbol-name 1 nil #1=""] 5] #1# format "%s(%s=\"%s\"%s%s%s)" "," allowed-args devices] 9 (#$ . 7235)]) (defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'") (defvar org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"") (defvar org-babel-R-write-object-command "{function(object,transfer.file){object;invisible(if(inherits(try({tfile<-tempfile();write.table(object,file=tfile,sep=\"\\t\",na=\"nil\",row.names=%s,col.names=%s,quote=FALSE);file.rename(tfile,transfer.file)},silent=TRUE),\"try-error\")){if(!file.exists(transfer.file))file.create(transfer.file)})}}(object=%s,transfer.file=\"%s\")") #@26 Evaluate R code in BODY. (defalias 'org-babel-R-evaluate #[(session body result-type result-params column-names-p row-names-p) "\203 \306 \n\f &\207\307 \n\f %\207" [session body result-type result-params column-names-p row-names-p org-babel-R-evaluate-session org-babel-R-evaluate-external-process] 7 (#$ . 8802)]) #@202 Evaluate BODY in external R process. If RESULT-TYPE equals 'output then return standard output as a string. If RESULT-TYPE equals 'value then return the value of the last statement in BODY, as elisp. (defalias 'org-babel-R-evaluate-external-process #[(body result-type result-params column-names-p row-names-p) "\306\307\"\203b \310\311!\312\n\313\f\203 \314\202 \315 \203( \f\203$ \316\202) \314\202) \315\313\317\"\320 \321\"%\"\210\322\323\235\204D \324\235\203Z \325\326!rq\210\327\216\330 !\210\331 +\202^ \332 \333\" \")\207\306\334\"\205n \312\n\"\207" [result-type tmp-file org-babel-R-command org-babel-R-write-object-command row-names-p column-names-p eql value org-babel-temp-file "R-" org-babel-eval format "TRUE" "FALSE" "NA" "{function ()\n{\n%s\n}}()" org-babel-process-file-name noquote org-babel-R-process-value-result "scalar" "verbatim" generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1=#:temp-buffer buffer-name kill-buffer] 2)) insert-file-contents buffer-string org-babel-import-elisp-from-file (16) output body result-params #1#] 10 (#$ . 9131)]) #@191 Evaluate BODY in SESSION. If RESULT-TYPE equals 'output then return standard output as a string. If RESULT-TYPE equals 'value then return the value of the last statement in BODY, as elisp. (defalias 'org-babel-R-evaluate-session #[(session body result-type result-params column-names-p row-names-p) "\306\307\"\203\205 \310\311!r q\210\312\216\313\n!c\210\314\315!!\316\317\316!\210-\320\321!9\3229\323:;\2038 \324\2029 \325<\203K ;\203G \326\202L \324\202L \325\327\3309\331\"%#\210\332\333=\235\204d \334=\235\203{ \310\311!>r>q\210\335\216\3369!\210\337 +\202\200 \3409\341\"<\")\207\306\342\"\205\343\313\344\345\316\346\347\346\350\212\351 ?\352\216\353!\204\247 \354\355\"\210q\210\356\316\211@AB\357CBC\360\216\361\315p!!b\210`dD\211ED{AED|\210*\343\313\nFD\362#c\210\363 \210Gb\210\212\364\365H!\316\366#\205\370 \364I\316\366#)\204\367\315p!!\210\202\342 \361\315p!!b\210Ac\210)\370BI\".\"\"\"!\362#\207" [result-type #1=#:temp-buffer body session ess-eval-visibly-p ess-local-process-name eql value generate-new-buffer " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) org-babel-chomp process-name get-buffer-process nil ess-eval-buffer org-babel-temp-file "R-" org-babel-comint-eval-invisibly-and-wait-for-file format "TRUE" "FALSE" "NA" ".Last.value" org-babel-process-file-name noquote org-babel-R-process-value-result "scalar" "verbatim" ((byte-code "\301!\203\n \302!\210\301\207" [#2=#:temp-buffer buffer-name kill-buffer] 2)) insert-file-contents buffer-string org-babel-import-elisp-from-file (16) output mapconcat butlast delq mapcar #[(line) "G\301V\205 \207" [line 0] 2] #[(line) "\301\302\"\203 \303\225\304O\207\207" [line string-match "^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)" 1 nil] 3] match-data ((byte-code "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" "" #[(text) " P\211\207" [string-buffer text] 2] ((byte-code "A\301\207" [comint-output-filter-functions nil] 1)) process-mark "\n" inferior-ess-send-input re-search-forward regexp-quote t accept-process-output split-string tmp-file org-babel-R-write-object-command row-names-p column-names-p result-params #2# save-match-data-internal raw dangling-text string-buffer comint-output-filter-functions end start org-babel-R-eoe-indicator comint-last-input-end org-babel-R-eoe-output comint-prompt-regexp] 14 (#$ . 10257)]) #@100 R-specific processing of return value. Insert hline if column names in output have been requested. (defalias 'org-babel-R-process-value-result #[(result column-names-p) "\203\f @\302 ABB\207 \207" [column-names-p result hline] 3 (#$ . 12778)]) (provide 'ob-R)