emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: William Denton <wtd@pobox.com>
To: Seb <spluque@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: R source code block :session
Date: Sun, 30 Sep 2018 14:10:07 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1809301406580.29898@shell.miskatonic.org> (raw)
In-Reply-To: <CBB7ED8D-286D-471C-8848-60B102684218@ucsd.edu>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1251 bytes --]

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 session 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 maybe use these header args:
>
> 	:session :results value drawer :prologue "capture.output({" :epilogue "})"

Having the "library" call in its own block, with results silent, also works.

#+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 "ℝ>" as m prompt and I 
ran into the same problem but found this got around it (though it's been a while 
and I can't remember for sure).  It also saves time when rerunning code because 
I don't reload stuff over and over.

Bill
--
William Denton :: Toronto, Canada   ---   Listening to Art: https://listeningtoart.org/
https://www.miskatonic.org/         ---   GHG.EARTH: http://ghg.earth/
Caveat lector.                      ---   STAPLR: http://staplr.org/

      reply	other threads:[~2018-09-30 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-30 15:18 R source code block :session Seb
2018-09-30 18:03 ` Berry, Charles
2018-09-30 18:10   ` William Denton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1809301406580.29898@shell.miskatonic.org \
    --to=wtd@pobox.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=spluque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).