all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Output of R code block: only text or plot but not both? And only one "result" can be output?
@ 2024-06-03 13:47 Giuseppe Pagnoni
  2024-06-05 17:36 ` Berry, Charles
  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
  0 siblings, 2 replies; 11+ messages in thread
From: Giuseppe Pagnoni @ 2024-06-03 13:47 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-07 10:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 13:47 Output of R code block: only text or plot but not both? And only one "result" can be output? Giuseppe Pagnoni
2024-06-05 17:36 ` 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

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.