all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* No results when combining :session *R* with print.xtable
@ 2016-03-10 19:11 Stephan Lindner
  2016-03-16 17:56 ` John Hendy
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Lindner @ 2016-03-10 19:11 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-16 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 19:11 No results when combining :session *R* with print.xtable Stephan Lindner
2016-03-16 17:56 ` John Hendy

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.