[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [babel] Emitting both text & graphics output
From: |
Ken.Williams |
Subject: |
[O] [babel] Emitting both text & graphics output |
Date: |
Tue, 22 Mar 2011 15:02:42 -0500 |
User-agent: |
Microsoft-MacOutlook/14.2.0.101115 |
Hi,
Suppose I have a source block like the following, which both 'print's some
text output and 'plot's to a graphics device:
------------------------------
#+begin_src R :file tp.png :exports both :results output graphics
dat <- matrix(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.
'C-c C-c' results in the following 'results' section:
------------------------------
#+results:
[[file:tp.png]]
------------------------------
And 'C-c C-e b' results in HTML output like this:
------------------------------
<pre class="src src-R">dat <span style="color: #008b8b;"><-</span>
matrix(runif(12), 6, 2)
print(dat)
plot(dat)
</pre>
<p>
<img src="tp.png" alt="tp.png" />
</p>
------------------------------
Neither of those have the actual printed matrix output, which would be
something like this:
------------------------------
#+begin_src R :exports both :results output
dat <- matrix(runif(12), 6, 2)
print(dat)
#+end_src
#+results:
: [,1] [,2]
: [1,] 0.3675202 0.1995134
: [2,] 0.9221087 0.1225686
: [3,] 0.6534830 0.6986238
: [4,] 0.3523151 0.1299406
: [5,] 0.7207582 0.5494278
: [6,] 0.3665547 0.6328452
------------------------------
Any clues? Thanks.
--
Ken Williams
Senior Research Scientist
Thomson Reuters
http://labs.thomsonreuters.com
- [O] [babel] Emitting both text & graphics output,
Ken.Williams <=