emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stephan Lindner <lindners@ohsu.edu>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: No results when combining :session *R* with print.xtable
Date: Thu, 10 Mar 2016 19:11:47 +0000	[thread overview]
Message-ID: <87bn6mtafl.fsf@ohsu.edu> (raw)

Hi,

I encounter the following problem (org version 8.3.2):

When I have the following R source code block in my org file:

#+BEGIN_SRC R :exports results :results replace output latex :eval export
library(xtable)
print(xtable(matrix(c(1,2,3), nrow=1)),
            only.contents=TRUE, include.rownames=FALSE, include.colnames=FALSE, comment=FALSE, hline.after=NULL)
#+END_SRC


and I evaluate it, I get the expected result:


#+RESULTS:
#+BEGIN_LaTeX
 1.00 & 2.00 & 3.00 \\ 

#+END_LaTeX

However, when I also include the =:session *R*= in my header, I get this: 

#+BEGIN_SRC R :session *R* :exports results :results replace output latex :eval export
library(xtable)
print(xtable(matrix(c(1,2,3), nrow=1)),
            only.contents=TRUE, include.rownames=FALSE, include.colnames=FALSE, comment=FALSE, hline.after=NULL)
#+END_SRC

#+RESULTS:
#+BEGIN_LaTeX
#+END_LaTeX

I.e., no result. However, when evaluating the code in R it works (i.e., R prints out =1.00 & 2.00 & 3.00 \\=).


I need to have =:session *R*= in the header because I want to print results of previous calculations in R. I would like
to not have =\hlines= in my LaTeX output (I integrate the result into a LaTeX table).

This problem does not occur when I set =hline.after= to a non-NULL value, e.g.:

#+BEGIN_SRC R :session *R* :exports results :results replace output latex :eval export
library(xtable)
print(xtable(matrix(c(1,2,3), nrow=1)),
            only.contents=TRUE, include.rownames=FALSE, include.colnames=FALSE, comment=FALSE, hline.after=1)
#+END_SRC

#+RESULTS:
#+BEGIN_LaTeX
 1.00 & 2.00 & 3.00 \\ 
   \hline
#+END_LaTeX


Thanks!


        Stephan 
-- 
Stephan Lindner, Ph.D.
Oregon Health and Science University

             reply	other threads:[~2016-03-10 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 19:11 Stephan Lindner [this message]
2016-03-16 17:56 ` No results when combining :session *R* with print.xtable John Hendy

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=87bn6mtafl.fsf@ohsu.edu \
    --to=lindners@ohsu.edu \
    --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).