From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ista Zahn Subject: Re: Interweaveing code and results with :session Date: Mon, 20 Aug 2012 07:10:22 -0400 Message-ID: References: <871uj2jvje.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3Psc-0003R6-Po for emacs-orgmode@gnu.org; Mon, 20 Aug 2012 07:10:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3Psa-0002YT-S5 for emacs-orgmode@gnu.org; Mon, 20 Aug 2012 07:10:46 -0400 Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:35755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3Psa-0002YJ-Ge for emacs-orgmode@gnu.org; Mon, 20 Aug 2012 07:10:44 -0400 Received: by lahd3 with SMTP id d3so3257302lah.0 for ; Mon, 20 Aug 2012 04:10:43 -0700 (PDT) In-Reply-To: <871uj2jvje.fsf@gmx.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode Mailinglist On Sun, Aug 19, 2012 at 7:40 PM, Eric Schulte wrote: > Ista Zahn 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