From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Denton Subject: Re: R source code block :session Date: Sun, 30 Sep 2018 14:10:07 -0400 (EDT) Message-ID: References: <87wor3ko9i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="657874830-1882465826-1538331007=:29898" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6gAX-0008U3-Mq for emacs-orgmode@gnu.org; Sun, 30 Sep 2018 14:10:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6gAS-0007w0-Li for emacs-orgmode@gnu.org; Sun, 30 Sep 2018 14:10:13 -0400 Received: from shell.miskatonic.org ([54.39.142.95]:41996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6gAS-0007vn-HL for emacs-orgmode@gnu.org; Sun, 30 Sep 2018 14:10:08 -0400 In-Reply-To: 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" To: Seb Cc: "emacs-orgmode@gnu.org" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --657874830-1882465826-1538331007=:29898 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 30 September 2018, Berry, Charles wrote: >> Notice the "R> " prompt that prefixes the actual output. > > The issue is that babel has to clean up dangling prompts from the R ses= sion buffer and is currently not smart enough to do this in your case. > ... > I think your easiest path forward is to use the default R prompt. Or ma= ybe use these header args: > > :session :results value drawer :prologue "capture.output({" :epilogue = "})" Having the "library" call in its own block, with results silent, also wor= ks. #+NAME: setup #+BEGIN_SRC R :session :results silent library(ascii) #+END_SRC #+NAME: test01 #+BEGIN_SRC R :session :results output numstbl <- table(1:4, 1:4) summary(numstbl) #+END_SRC That's how I usually do things, perhaps because I use "=E2=84=9D>" as m p= rompt and I=20 ran into the same problem but found this got around it (though it's been = a while=20 and I can't remember for sure). It also saves time when rerunning code b= ecause=20 I don't reload stuff over and over. Bill -- William Denton :: Toronto, Canada --- Listening to Art: https://liste= ningtoart.org/ https://www.miskatonic.org/ --- GHG.EARTH: http://ghg.earth/ Caveat lector. --- STAPLR: http://staplr.org/ --657874830-1882465826-1538331007=:29898--