all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Giuseppe Pagnoni <gpagnoni@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Output of R code block: only text or plot but not both? And only one "result" can be output?
Date: Mon, 3 Jun 2024 15:47:45 +0200	[thread overview]
Message-ID: <CAAdktEx-=8DvG7LNkkKg7fJC06QoSNY_buKDaqDbKKmeBK9EBA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]

Hi,

I am trying to have an R code block output both the results of a numerical
expression AND a plot, but if I set up the header arguments to display the
plot, the numerical outcome is not displayed.  A simple example:

#+begin_src R :file example.png :results output graphics file
  x <- rnorm(100)
  print(mean(x))
  hist(x)
#+end_src

Here I get the histogram plot back in the buffer, but NOT the result of
"print(mean(x))".   Is it not possible to get both?

Furthermore, what if I wanted to display *two* or more plots that get built
by the code, for instance:

#+begin_src R :file example.png :results output graphics file
  x <- rnorm(100)
  print(mean(x))
  hist(x)
  hist(x^2)
#+end_src

Here, only the last plot gets displayed.  Is it not possible to display
more than 1 plot?

many thanks in advance for any help

giuseppe
-- 
Giuseppe Pagnoni
Dip. Scienze Biomediche, Metaboliche e Neuroscienze
Sezione Fisiologia e Neuroscienze
Univ. di Modena e Reggio Emilia
Via Campi 287
I-41125 Modena, Italy
Tel: +39-059-205-5742
Fax: +39-059-205-5363

[-- Attachment #2: Type: text/html, Size: 1486 bytes --]

             reply	other threads:[~2024-06-05 14:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 13:47 Giuseppe Pagnoni [this message]
2024-06-05 17:36 ` Output of R code block: only text or plot but not both? And only one "result" can be output? Berry, Charles
2024-06-05 18:17   ` [FR] Org babel: mixing multiple outputs (was: Output of R code block: only text or plot but not both? And only one "result" can be output?) Ihor Radchenko
2024-06-05 20:34     ` Berry, Charles
2024-06-07 10:46       ` Ideas for improving ob-R (was: [FR] Org babel: mixing multiple outputs (was: Output of R code block: only text or plot but not both? And only one "result" can be output?)) Ihor Radchenko
2024-06-05 18:37 ` Output of R code block: only text or plot but not both? And only one "result" can be output? Ihor Radchenko
2024-06-07  8:56   ` Giuseppe Pagnoni
2024-06-07  9:10   ` Giuseppe Pagnoni
2024-06-07  9:19     ` Ihor Radchenko
2024-06-07  9:31       ` Giuseppe Pagnoni
2024-06-07  9:39       ` Giuseppe Pagnoni

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

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

  git send-email \
    --in-reply-to='CAAdktEx-=8DvG7LNkkKg7fJC06QoSNY_buKDaqDbKKmeBK9EBA@mail.gmail.com' \
    --to=gpagnoni@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.