suvayu ali <fatkasuvayu+li...@gmail.com> wrote:

> On Tue, Mar 22, 2011 at 1:02 PM,  <ken.willi...@thomsonreuters.com> 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---


Reply via email to