|
@@ -30,6 +30,30 @@ options (maybe more)
|
|
|
|
|
|
|
|
This is now implemented see the example in the [[* silent evaluation][sandbox]]
|
|
This is now implemented see the example in the [[* silent evaluation][sandbox]]
|
|
|
|
|
|
|
|
|
|
+** TODO insert 2-D R results as tables
|
|
|
|
|
+** TODO allow variable initialization from source blocks
|
|
|
|
|
+Currently it is possible to initialize a variable from an org-mode
|
|
|
|
|
+table with a block argument like =table=sandbox= (note that the
|
|
|
|
|
+variable doesn't have to named =table=) as in the following example
|
|
|
|
|
+
|
|
|
|
|
+#+TBLNAME: sandbox
|
|
|
|
|
+| 1 | 2 | 3 |
|
|
|
|
|
+| 4 | schulte | 6 |
|
|
|
|
|
+
|
|
|
|
|
+#+begin_src emacs-lisp :var table=sandbox :results replace
|
|
|
|
|
+(message (format "table = %S" table))
|
|
|
|
|
+#+end_src
|
|
|
|
|
+
|
|
|
|
|
+: "table = ((1 2 3) (4 \"schulte\" 6))"
|
|
|
|
|
+
|
|
|
|
|
+It would be good to allow initialization of variables from the results
|
|
|
|
|
+of other source blocks in the same manner. This would probably
|
|
|
|
|
+require the addition of =#+SRCNAME: example= lines for the naming of
|
|
|
|
|
+source blocks, also the =table=sandbox= syntax may have to be expanded
|
|
|
|
|
+to specify whether the target is a source code block or a table
|
|
|
|
|
+(alternately we could just match the first one with the given name
|
|
|
|
|
+whether it's a table or a source code block).
|
|
|
|
|
+
|
|
|
|
|
|
|
|
* Bugs
|
|
* Bugs
|
|
|
** Args out of range error
|
|
** Args out of range error
|
|
@@ -64,7 +88,7 @@ or later.
|
|
|
To run these examples open both [[file:litorgy/litorgy.el][litorgy.el]], [[file:litorgy/litorgy-script.el][litorgy-script.el]] and
|
|
To run these examples open both [[file:litorgy/litorgy.el][litorgy.el]], [[file:litorgy/litorgy-script.el][litorgy-script.el]] and
|
|
|
evaluate them with =M-x eval-buffer=
|
|
evaluate them with =M-x eval-buffer=
|
|
|
|
|
|
|
|
-#+begin_src sh :replace t
|
|
|
|
|
|
|
+#+begin_src sh :results replace
|
|
|
date
|
|
date
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
@@ -81,7 +105,7 @@ print "Hello world!"
|
|
|
To run these examples open both [[file:litorgy/litorgy.el][litorgy.el]], [[file:litorgy/litorgy-R.el][litorgy-R.el]] and evaluate
|
|
To run these examples open both [[file:litorgy/litorgy.el][litorgy.el]], [[file:litorgy/litorgy-R.el][litorgy-R.el]] and evaluate
|
|
|
them with =M-x eval-buffer=
|
|
them with =M-x eval-buffer=
|
|
|
|
|
|
|
|
-#+begin_src R :replace t
|
|
|
|
|
|
|
+#+begin_src R :results replace
|
|
|
a <- 9
|
|
a <- 9
|
|
|
b <- 17
|
|
b <- 17
|
|
|
a + b
|
|
a + b
|
|
@@ -164,36 +188,36 @@ out...
|
|
|
| 1 | 2 | 3 |
|
|
| 1 | 2 | 3 |
|
|
|
| 4 | schulte | 6 |
|
|
| 4 | schulte | 6 |
|
|
|
|
|
|
|
|
-#+begin_src emacs-lisp :var table=previous :replace t
|
|
|
|
|
|
|
+#+begin_src emacs-lisp :var table=previous :results replace
|
|
|
(transpose table)
|
|
(transpose table)
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
|
-#+begin_src emacs-lisp :var table=sandbox :replace t
|
|
|
|
|
|
|
+#+begin_src emacs-lisp :var table=sandbox :results replace
|
|
|
(transpose table)
|
|
(transpose table)
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
|
*** Ruby and Python
|
|
*** Ruby and Python
|
|
|
|
|
|
|
|
-#+begin_src ruby :var table=sandbox :replace t
|
|
|
|
|
|
|
+#+begin_src ruby :var table=sandbox :results replace
|
|
|
table.first.join(" - ")
|
|
table.first.join(" - ")
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
|
: "1 - 2 - 3"
|
|
: "1 - 2 - 3"
|
|
|
|
|
|
|
|
-#+begin_src python :var table=sandbox :replace t
|
|
|
|
|
|
|
+#+begin_src python :var table=sandbox :results replace
|
|
|
table[0]
|
|
table[0]
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
|
| 1 | 2 | 3 |
|
|
| 1 | 2 | 3 |
|
|
|
|
|
|
|
|
-#+begin_src ruby :var table=sandbox :replace t
|
|
|
|
|
|
|
+#+begin_src ruby :var table=sandbox :results replace
|
|
|
table
|
|
table
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
|
| 1 | 2 | 3 |
|
|
| 1 | 2 | 3 |
|
|
|
| 4 | "schulte" | 6 |
|
|
| 4 | "schulte" | 6 |
|
|
|
|
|
|
|
|
-#+begin_src python :var table=sandbox :replace t
|
|
|
|
|
|
|
+#+begin_src python :var table=sandbox :results replace
|
|
|
table
|
|
table
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
@@ -202,13 +226,13 @@ table
|
|
|
|
|
|
|
|
*** R
|
|
*** R
|
|
|
|
|
|
|
|
-#+begin_src R :replace t
|
|
|
|
|
|
|
+#+begin_src R :results replace
|
|
|
a <- 9
|
|
a <- 9
|
|
|
b <- 8
|
|
b <- 8
|
|
|
|
|
|
|
|
#+end_src
|
|
#+end_src
|
|
|
|
|
|
|
|
-#+begin_src R :replace t
|
|
|
|
|
|
|
+#+begin_src R :results replace
|
|
|
x <- c(rnorm(10, mean=-3, sd=1), rnorm(10, mean=3, sd=1))
|
|
x <- c(rnorm(10, mean=-3, sd=1), rnorm(10, mean=3, sd=1))
|
|
|
x
|
|
x
|
|
|
#+end_src
|
|
#+end_src
|