emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: suvayu ali <fatkasuvayu+linux@gmail.com>
Cc: Ken.Williams@thomsonreuters.com, nicholas.dokos@hp.com,
	emacs-orgmode@gnu.org
Subject: Re: [babel] Emitting both text & graphics output
Date: Tue, 22 Mar 2011 21:20:56 -0400	[thread overview]
Message-ID: <3349.1300843256@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from suvayu ali <fatkasuvayu+linux@gmail.com> of "Tue, 22 Mar 2011 16:28:38 PDT." <AANLkTinTEZZNCrMQZQSWhqu90vmHO1JevzFND3OHNGSF@mail.gmail.com>

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

> On Tue, Mar 22, 2011 at 1:02 PM,  <Ken.Williams@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	other threads:[~2011-03-23  1:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 20:02 [babel] Emitting both text & graphics output Ken.Williams
2011-03-22 21:06 ` Mikhail Titov
2011-03-22 23:28 ` suvayu ali
2011-03-23  1:20   ` Nick Dokos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3349.1300843256@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=Ken.Williams@thomsonreuters.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fatkasuvayu+linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).