emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Seb <spluque@gmail.com>
To: emacs-orgmode@gnu.org
Subject: R source code block :session
Date: Sun, 30 Sep 2018 10:18:01 -0500	[thread overview]
Message-ID: <87wor3ko9i.fsf@gmail.com> (raw)

Hello,

I'm running into a couple of issues with R source code blocks using
:session :

---<--------------------cut here---------------start------------------->---
#+NAME: test01
#+BEGIN_SRC R :session :results output
library(ascii)
numstbl <- table(1:4, 1:4)
summary(numstbl)
#+END_SRC

#+RESULTS: test01
: R> Number of cases in table: 4
: Number of factors: 2
: Test for independence of all factors:
: 	Chisq = 12, df = 9, p-value = 0.2
: 	Chi-squared approximation may be incorrect
---<--------------------cut here---------------end--------------------->---

Notice the "R> " prompt that prefixes the actual output.  If the first
line (`library` call) is removed, then the prompt is correctly excluded
from the results output.  I do have `options(prompt="R> ")` in my
~/.Rprofile.

The other problem:

---<--------------------cut here---------------start------------------->---
#+NAME: test02
#+BEGIN_SRC R :results output org
library(ascii)
options(asciiType="org")
ascii(summary(table(1:4, 1:4)))
#+END_SRC

#+RESULTS: test02
#+BEGIN_SRC org
- Number of cases in table: 4
- Number of factors: 2
- Test for independence of all factors:
  - Chisq = 12, df = 9, p-value = 0.2
  - Chi-squared approximation may be incorrect
#+END_SRC
---<--------------------cut here---------------end--------------------->---

According to the documentation
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html, the
results output should be wrapped in #+BEGIN_ORG #+END_ORG, not in
another source code block.

Any tips much appreciated.

Cheers,
-- 
Seb

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

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

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=87wor3ko9i.fsf@gmail.com \
    --to=spluque@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).