* Interweaveing code and results with :session
@ 2012-08-18 15:06 Ista Zahn
2012-08-19 23:40 ` Eric Schulte
0 siblings, 1 reply; 3+ messages in thread
From: Ista Zahn @ 2012-08-18 15:06 UTC (permalink / raw)
To: emacs-orgmode Mailinglist
Hi,
I would like to interweave multi-line R code and results, like this:
#+begin_src R :results output
2+2
3+3
#+end_src
#+results:
: > 2+2
: [1] 4
: > 3+3
: [1] 6
while using R :session. The solution posted at
http://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00785.html
is to set
#+begin_src emacs-lisp
(setq org-babel-R-command "R --silent --no-save")
#+end_src
This works, but only if session is not being used. For example:
--8<---------------cut here---------------start------------->8---
#+begin_src emacs-lisp
(setq org-babel-R-command "R --silent --no-save")
#+end_src
#+results:
: R --silent --no-save
This works as desired:
#+begin_src R :results output
2+2
3+3
#+end_src
#+RESULTS:
: > 2+2
: [1] 4
: > 3+3
: [1] 6
: >
Does not interweave code and results when using :session:
#+begin_src R :results output :session *R*
2+2
3+3
#+end_src
#+results:
: [1] 4
: [1] 6
--8<---------------cut here---------------end--------------->8---
Is there a way to get this interweaved output while using :session?
Thanks!
Ista
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interweaveing code and results with :session
2012-08-18 15:06 Interweaveing code and results with :session Ista Zahn
@ 2012-08-19 23:40 ` Eric Schulte
2012-08-20 11:10 ` Ista Zahn
0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2012-08-19 23:40 UTC (permalink / raw)
To: Ista Zahn; +Cc: emacs-orgmode Mailinglist
Ista Zahn <istazahn@gmail.com> writes:
> Hi,
>
> I would like to interweave multi-line R code and results, like this:
>
> #+begin_src R :results output
> 2+2
> 3+3
> #+end_src
>
> #+results:
> : > 2+2
> : [1] 4
> : > 3+3
> : [1] 6
>
> while using R :session. The solution posted at
> http://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00785.html
> is to set
>
> #+begin_src emacs-lisp
> (setq org-babel-R-command "R --silent --no-save")
> #+end_src
>
> This works, but only if session is not being used. For example:
>
> --8<---------------cut here---------------start------------->8---
> #+begin_src emacs-lisp
> (setq org-babel-R-command "R --silent --no-save")
> #+end_src
>
> #+results:
> : R --silent --no-save
>
> This works as desired:
> #+begin_src R :results output
> 2+2
> 3+3
> #+end_src
>
> #+RESULTS:
> : > 2+2
> : [1] 4
> : > 3+3
> : [1] 6
> : >
>
> Does not interweave code and results when using :session:
> #+begin_src R :results output :session *R*
> 2+2
> 3+3
> #+end_src
>
> #+results:
> : [1] 4
> : [1] 6
> --8<---------------cut here---------------end--------------->8---
>
> Is there a way to get this interweaved output while using :session?
>
Unfortunately I do not believe this is currently possible, however it
shouldn't be hard to implement for someone familiar with ob-R.el.
Best,
>
> Thanks!
> Ista
>
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interweaveing code and results with :session
2012-08-19 23:40 ` Eric Schulte
@ 2012-08-20 11:10 ` Ista Zahn
0 siblings, 0 replies; 3+ messages in thread
From: Ista Zahn @ 2012-08-20 11:10 UTC (permalink / raw)
To: Eric Schulte; +Cc: emacs-orgmode Mailinglist
On Sun, Aug 19, 2012 at 7:40 PM, Eric Schulte <eric.schulte@gmx.com> wrote:
> Ista Zahn <istazahn@gmail.com> writes:
>
>> Hi,
>>
>> I would like to interweave multi-line R code and results, like this:
>>
>> #+begin_src R :results output
>> 2+2
>> 3+3
>> #+end_src
>>
>> #+results:
>> : > 2+2
>> : [1] 4
>> : > 3+3
>> : [1] 6
>>
>> while using R :session. The solution posted at
>> http://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00785.html
>> is to set
>>
>> #+begin_src emacs-lisp
>> (setq org-babel-R-command "R --silent --no-save")
>> #+end_src
>>
>> This works, but only if session is not being used. For example:
>>
>> --8<---------------cut here---------------start------------->8---
>> #+begin_src emacs-lisp
>> (setq org-babel-R-command "R --silent --no-save")
>> #+end_src
>>
>> #+results:
>> : R --silent --no-save
>>
>> This works as desired:
>> #+begin_src R :results output
>> 2+2
>> 3+3
>> #+end_src
>>
>> #+RESULTS:
>> : > 2+2
>> : [1] 4
>> : > 3+3
>> : [1] 6
>> : >
>>
>> Does not interweave code and results when using :session:
>> #+begin_src R :results output :session *R*
>> 2+2
>> 3+3
>> #+end_src
>>
>> #+results:
>> : [1] 4
>> : [1] 6
>> --8<---------------cut here---------------end--------------->8---
>>
>> Is there a way to get this interweaved output while using :session?
>>
>
> Unfortunately I do not believe this is currently possible, however it
> shouldn't be hard to implement for someone familiar with ob-R.el.
Thanks Eric. I'm able to get the desired behavior by setting
(setq org-babel-R-command "R --silent --save --restore")
instead of using :session
Obviously this is slow, and has other disadvantagages, but it does
give interweaved results while allowing object persistance across code
blocks.
Best,
Ista
>
> Best,
>
>>
>> Thanks!
>> Ista
>>
>
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-20 11:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-18 15:06 Interweaveing code and results with :session Ista Zahn
2012-08-19 23:40 ` Eric Schulte
2012-08-20 11:10 ` Ista Zahn
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.