From: John Hendy <jw.hendy@gmail.com>
To: Andreas Kiermeier <andreas.kiermeier@gmail.com>
Cc: emacs-orgmode <Emacs-orgmode@gnu.org>,
Eric Schulte <schulte.eric@gmail.com>
Subject: Re: R code block produces only partial output
Date: Mon, 4 Aug 2014 23:00:23 -0500 [thread overview]
Message-ID: <CA+M2ft-35PbLKgKMSrQH0qXAo2BNM74XkfGOc+ScX+cs9YFF-g@mail.gmail.com> (raw)
In-Reply-To: <CAN7vk5S8aBgYjty54WTRLZ8FOwynBKa8aSNF5anTZ8njeYaTqg@mail.gmail.com>
On Mon, Aug 4, 2014 at 7:46 PM, Andreas Kiermeier
<andreas.kiermeier@gmail.com> wrote:
> Hi Eric,
> I'm running Org 8.2.7c (via ELPA) and ESS 14.05.
> I've tried to run with a minimal Org setup using only the following in
> my init file.
> The shortcut I use to start Emacs (on Windows 8.1) is:
> C:\emacs\bin\runemacs.exe -Q -l "C:\emacs\bin\minimal-org.el"
>
> However, the results are the same as before. Any thoughts on what else
> I could try?
>
[snip]
I can reproduce with a minimal config and on Linux (to toss in a
confirmation). I *also* accidentally just stumbled on a way I can
toggle the behavior between correct and incorrect! It arose because my
file was not able to use the #+PROPERTY settings you have -- my
results were not obeying what I had set. I looked around and believe
the syntax is correct per this page:
- http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html
However, I guarantee that the results weren't updating to ":results
output drawer" as I had them set. I also noticed that the
"header-args:R :session *R*" also didn't seem to be working, as if I
changed the name, Emacs wouldn't ask me if I wanted to create a new R
session upon block execution. Here's what I've found:
Correct results:
#+begin_src org
#+STARTUP: showall indent hidestars
#+PROPERTY: header-args:R :session r
#+BEGIN_SRC R :results output drawer
require(rms)
set.seed(123)
x <- rnorm(100)
describe(x)
#+END_SRC
#+RESULTS:
:RESULTS:
x
n missing unique Mean .05 .10 .25 .50
100 0 100 0.09041 -1.26508 -1.06822 -0.49385 0.06176
.75 .90 .95
0.69182 1.26450 1.56653
lowest : -2.309 -1.967 -1.687 -1.549 -1.265
highest: 1.715 1.787 2.050 2.169 2.187
:END:
#+end_src
Incorrect results:
#+begin_src org
#+STARTUP: showall indent hidestars
#+BEGIN_SRC R :session r :results output drawer
require(rms)
set.seed(123)
x <- rnorm(100)
describe(x)
#+END_SRC
#+RESULTS:
:RESULTS:
75 .90 .95
0.69182 1.26450 1.56653
lowest : -2.309 -1.967 -1.687 -1.549 -1.265
highest: 1.715 1.787 2.050 2.169 2.187
:END:
#+end_src
The reason, I think, is this (also correct):
#+begin_src org
#+STARTUP: showall indent hidestars
#+BEGIN_SRC R :results output drawer
require(rms)
set.seed(123)
x <- rnorm(100)
describe(x)
#+END_SRC
#+RESULTS:
:RESULTS:
x
n missing unique Mean .05 .10 .25 .50
100 0 100 0.09041 -1.26508 -1.06822 -0.49385 0.06176
.75 .90 .95
0.69182 1.26450 1.56653
lowest : -2.309 -1.967 -1.687 -1.549 -1.265
highest: 1.715 1.787 2.050 2.169 2.187
:END:
#+end_src
So, session settings in the #+PROPERTY config *or* no session set at
all yields correct results. Again, on a fresh start the #+PROPERTY
method does not ask to start a new R session. Last confirmation is
that if one leaves the session #+PROPERTY line (with none in the code
block) and comments out the "require(rms)" line after already having
run the block, you get the error "Could not find the function
'describe'". So, there's no session activity finding the
already-loaded library.
The remaining questions for me is why would results differ depending
on whether or not it's going through a session?
Eric: this also explains why your minimal .org file couldn't
reproduce: there's no setting of the session (again, not sure why that
matters... but it seems to).
John
next prev parent reply other threads:[~2014-08-05 4:00 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-04 11:18 R code block produces only partial output Andreas Kiermeier
2014-08-04 11:53 ` Eric Schulte
2014-08-04 12:23 ` Andreas Kiermeier
2014-08-04 13:10 ` Eric Schulte
2014-08-05 0:46 ` Andreas Kiermeier
2014-08-05 4:00 ` John Hendy [this message]
2014-08-05 4:31 ` Andreas Kiermeier
2014-08-05 18:05 ` Charles Berry
2014-08-05 19:02 ` Eric Schulte
2014-08-05 19:11 ` John Hendy
2014-08-05 19:57 ` Nick Dokos
2014-08-05 20:10 ` Nick Dokos
2014-08-05 22:21 ` Charles C. Berry
2014-08-06 3:32 ` Aaron Ecay
2014-08-06 11:30 ` Eric Schulte
2014-08-07 6:00 ` Aaron Ecay
2014-08-07 17:42 ` Charles C. Berry
2014-08-07 18:06 ` Aaron Ecay
2014-08-07 18:42 ` Charles C. Berry
2014-08-07 19:06 ` Thomas S. Dye
2014-08-09 8:54 ` Rainer M Krug
2014-08-16 5:05 ` Aaron Ecay
2014-08-16 18:50 ` Charles C. Berry
2014-08-16 20:58 ` Aaron Ecay
2014-08-17 6:03 ` Achim Gratz
2014-08-19 0:13 ` Aaron Ecay
2014-08-19 5:36 ` Achim Gratz
2014-08-23 8:32 ` Aaron Ecay
2014-08-23 9:24 ` Andreas Kiermeier
2014-08-23 17:10 ` Aaron Ecay
2014-08-23 18:35 ` Thomas S. Dye
2014-08-23 19:37 ` Ista Zahn
2014-08-24 0:10 ` Charles C. Berry
2014-08-28 5:24 ` Aaron Ecay
2014-09-01 5:00 ` Aaron Ecay
2014-09-01 16:08 ` Charles C. Berry
2014-08-09 8:48 ` Rainer M Krug
2014-08-06 1:11 ` Andreas Kiermeier
2014-08-06 2:21 ` Charles C. Berry
2014-08-06 3:24 ` Aaron Ecay
2014-08-06 15:59 ` Charles C. Berry
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+M2ft-35PbLKgKMSrQH0qXAo2BNM74XkfGOc+ScX+cs9YFF-g@mail.gmail.com \
--to=jw.hendy@gmail.com \
--cc=Emacs-orgmode@gnu.org \
--cc=andreas.kiermeier@gmail.com \
--cc=schulte.eric@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.