[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] R source code block :session
From: |
Seb |
Subject: |
[O] R source code block :session |
Date: |
Sun, 30 Sep 2018 10:18:01 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
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
- [O] R source code block :session,
Seb <=