[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [babel] Emitting both text & graphics output
From: |
Nick Dokos |
Subject: |
Re: [O] [babel] Emitting both text & graphics output |
Date: |
Tue, 22 Mar 2011 21:20:56 -0400 |
suvayu ali <address@hidden> wrote:
> On Tue, Mar 22, 2011 at 1:02 PM, <address@hidden> wrote:
> > ------------------------------
> > #+begin_src R :file tp.png :exports both :results output graphics
> > dat <- =A0matrix(runif(12), 6, 2)
> > print(dat)
> > plot(dat)
> > #+end_src
> > ------------------------------
> >
> >
> >
> > I can't seem to get the print() output to display, either by exporting to
> > HTML or by simple evaluation of the code block.
>
>
> Exporting to HTML includes a plot for me. Are you sure you activated R prop=
> erly?
>
... but it doesn't include the print(dat) output. That's what the OP wanted
I think.
Nick
PS. the session trick that Mikhail Titov suggested works well:
--8<---------------cut here---------------start------------->8---
* Foo
#+begin_src R :session *R* :exports both :results output
dat <- matrix(runif(12), 6, 2)
print(dat)
#+end_src
#+results:
: [,1] [,2]
: [1,] 0.3459181 0.04018971
: [2,] 0.9300838 0.75353098
: [3,] 0.4234347 0.51248641
: [4,] 0.3713377 0.23556420
: [5,] 0.2572491 0.73720994
: [6,] 0.7233642 0.58195861
#+begin_src R :session *R* :exports both :results graphics :file tp.png
plot(dat)
#+end_src
#+results:
[[file:tp.png]]
--8<---------------cut here---------------end--------------->8---