R support partially working assigning variables from R

still need to figure out how to deal with R tables
This commit is contained in:
Eric Schulte 2009-04-03 15:56:02 -07:00
parent 0e29fb3601
commit 3e403fc9bb
3 changed files with 28 additions and 3 deletions

View File

@ -40,6 +40,11 @@ called by `litorgy-execute-src-block'."
(save-window-excursion
(let ((vars (litorgy-ref-variables params))
results)
(message (format "--%S--" vars))
(mapc (lambda (pair)
(litorgy-R-input-command
(format "%s <- %s" (car pair) (cdr pair))))
vars)
(litorgy-R-initiate-R-buffer)
(litorgy-R-command-to-string body))))

View File

@ -161,7 +161,9 @@ replace - insert results after the source block replacing any
previously inserted results
silent -- no results are inserted"
(unless (listp result) (setq result (format "%S" result)))
(if (stringp result)
(setq result (litorgy-clean-text-properties result))
(unless (listp result) (setq result (format "%S" result))))
(if (string-equal insert "replace") (litorgy-remove-result (listp result)))
(if (= (length result) 0)
(message "no result returned by source block")

View File

@ -239,9 +239,11 @@ table
#+begin_src R :results replace
a <- 9
b <- 8
b*a
#+end_src
: 72
#+begin_src R :results replace
x <- c(rnorm(10, mean=-3, sd=1), rnorm(10, mean=3, sd=1))
x
@ -328,9 +330,11 @@ and for python
#+end_src
#+begin_src python :var another=start_two :results replace
another + 3
another*3
#+end_src
: 294
*** mixed languages
Since all variables are converted into Emacs Lisp it is no problem to
reference variables specified in another language.
@ -352,6 +356,20 @@ lisp_var + 4
*** R
not yet implemented
#+srcname: first_r
#+begin_src R :results replace
a <- 9
a
#+end_src
: 9
#+begin_src R :var other=first_r :results replace
other + 2
#+end_src
: 11
* COMMENT Commentary
I'm seeing this as like commit notes, and a place for less formal