From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mikhail Titov" Subject: RE: [babel] Emitting both text & graphics output Date: Tue, 22 Mar 2011 16:06:30 -0500 Message-ID: <001101cbe8d5$0467f130$0d37d390$@us> References: Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=52329 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q28mg-0005Ij-Vq for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 17:06:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q28mf-0005md-L1 for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 17:06:34 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:57071) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q28mf-0005mE-Eh for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 17:06:33 -0400 In-Reply-To: Content-Language: en-us List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ken.Williams@thomsonreuters.com, emacs-orgmode@gnu.org I'm just a newbie user of org & babel, but as a workaround I'd split it into several blocks and use session based work. For instance I have the following in my dot emacs: (setq org-babel-default-header-args:R '((:results . "output") (:session . "*R*"))) This way I can always see what is going on within ESS in *R* buffer and all variables are preserved. Mikhail > -----Original Message----- > From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode- > bounces+mlt=gmx.us@gnu.org] On Behalf Of Ken.Williams@thomsonreuters.com > Sent: Tuesday, March 22, 2011 3:03 PM > To: emacs-orgmode@gnu.org > Subject: [O] [babel] Emitting both text & graphics output > > 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: > > ------------------------------ >
dat <-
> matrix(runif(12), 6, 2)
> print(dat)
> plot(dat)
> 
>

> tp.png >

> > ------------------------------ > > > > 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 >