* Beginner's question
@ 2012-06-21 5:11 Neuwirth Erich
2012-06-21 8:53 ` Sebastien Vauban
0 siblings, 1 reply; 4+ messages in thread
From: Neuwirth Erich @ 2012-06-21 5:11 UTC (permalink / raw)
To: emacs-orgmode
I am using R.
I am combining large data frames, and I am getting into memory problems.
Therefore I would like to to this in separate steps and after each step the R process should be closed to free memory.
When I do not use the :session argument for the code blocks, it seems that the R process is terminated
after the code is run.
I also tried to use separate sessions to achieve what I want and in each code block I used
quit(save="no")
at the end.
That did not work.
I would like to use a piece of initialization code in each of these code blocks but could not
find an understandable example how to use name code blocks and noweb references
to achieve this. Or can I do out with #+name: and a :var header argument?
Is there a way to do this?
I tried to understand :var with the following example
The first code block is from the docs and it works.
The second is by me and it does not work.
Can anybody explain why my example does not work?
#+TBLNAME: example-table
|1|
|2|
|3|
|4|
#+NAME: table-length
#+BEGIN_SRC emacs-lisp :var table=example-table
(length table)
#+END_SRC
#+RESULTS: table-length
: 4
#+name: xvar
123
#+name: myblock
#+begin_src emacs-lisp :var xxx=xvar
(* xxx xxx)
#+end_src
I need to pass string constants and numeric values o code segments this way.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Beginner's question
2012-06-21 5:11 Beginner's question Neuwirth Erich
@ 2012-06-21 8:53 ` Sebastien Vauban
2012-06-21 10:27 ` suvayu ali
0 siblings, 1 reply; 4+ messages in thread
From: Sebastien Vauban @ 2012-06-21 8:53 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Erich,
Neuwirth Erich wrote:
> Can anybody explain why my example does not work?
>
> #+TBLNAME: example-table
> |1|
> |2|
> |3|
> |4|
> #+NAME: table-length
> #+BEGIN_SRC emacs-lisp :var table=example-table
> (length table)
> #+END_SRC
>
> #+RESULTS: table-length
> : 4
> #+name: xvar
> 123
> #+name: myblock
> #+begin_src emacs-lisp :var xxx=xvar
> (* xxx xxx)
> #+end_src
>
> I need to pass string constants and numeric values o code segments this way.
Put a `:' in front of your value. That way, Babel can locate and read the
value.
#+name: xvar
: 123
#+name: myblock
#+begin_src emacs-lisp :var xxx=xvar
(* xxx xxx)
#+end_src
#+results: myblock
: 15129
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Beginner's question
2012-06-21 8:53 ` Sebastien Vauban
@ 2012-06-21 10:27 ` suvayu ali
2012-06-21 11:28 ` Sebastien Vauban
0 siblings, 1 reply; 4+ messages in thread
From: suvayu ali @ 2012-06-21 10:27 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
On Thu, Jun 21, 2012 at 10:53 AM, Sebastien Vauban
<wxhgmqzgwmuf@spammotel.com> wrote:
> Put a `:' in front of your value. That way, Babel can locate and read the
> value.
I didn't know about this syntax! Thanks a lot. :)
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Beginner's question
2012-06-21 10:27 ` suvayu ali
@ 2012-06-21 11:28 ` Sebastien Vauban
0 siblings, 0 replies; 4+ messages in thread
From: Sebastien Vauban @ 2012-06-21 11:28 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Suvayu,
suvayu ali wrote:
> On Thu, Jun 21, 2012 at 10:53 AM, Sebastien Vauban
> <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> wrote:
>> Put a `:' in front of your value. That way, Babel can locate and read the
>> value.
>
> I didn't know about this syntax! Thanks a lot. :)
It simply is the way short results (a few lines) are presented... No black
magic ;-)
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-21 11:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21 5:11 Beginner's question Neuwirth Erich
2012-06-21 8:53 ` Sebastien Vauban
2012-06-21 10:27 ` suvayu ali
2012-06-21 11:28 ` Sebastien Vauban
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.