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