From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id wJa3FMDLYmZlVwAAA41jLg (envelope-from ) for ; Fri, 07 Jun 2024 10:58:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +H25DMDLYmYmFQEA62LTzQ (envelope-from ) for ; Fri, 07 Jun 2024 10:58:40 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=OSB3GFhg; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717750720; a=rsa-sha256; cv=none; b=GhjRAxiqcTrmr0ulYSNOcaD/S0Z05ppSsCs8fBn/64+com5ayt6+nq6PYlpG4xWdfa+b7S CFkhvLqVnb3Bfqru5+OXTI6G626Fj47gfSp7t4nHANPGDNsbvXJcOMZRANpGhBf83RzlWO KYdPYgZoQks5DUxWWsnJr3ymloJhMTjwsD7IPOsIHNwnsNkRI6wfpzWrpbjaURASlEdQ1B OsTVhu7t+bXht3RoisH2/ZrAoijh0iEcTQFG0Gz61HgWFFFmu7FPz/pEIw4j5ePc4eYLdN vGfuUqzB3nN8vG/vVHpzCO64R3cGPCxRoqry8a1T2dEUjNcCe2D5fCIw8CiZbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=OSB3GFhg; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717750720; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=B9HCsMEEiNdYgdyWVfCoesfYLzdibl0XQ2V/RCg45Qc=; b=jpmGTZhyU0CSh+VapRjVDoPwFfT8DmEj/i7eZ1HfH5h7cPeLPsnWK3GcBsMhGEu1jk41bB lu/7OV6vPDuAfgzsvrByAM+NC0RFZGIE0FBqeuwV5iC7s3iAiuOBcu4kABvV2vF9mvBwp6 Uj1l1/0dLr22zLTQECOMai+BYF/rgXqsPDcP8bnxYGEp83z03+jfvqLCgSD0cUcsg4JjhO RwTj30hZ1oFRAcvxhHp+qra+oQnPqgGHs5OF+hYpEtOJoZwUmeOAnFC8lVYA/2TiE6D8wb 44X4UTVMrajIESxxL+XbDlXi/wf1Wu7uzYbiT5pmtdHj9Qo2RdGUr+lyyRyHaQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 923E169B3E for ; Fri, 7 Jun 2024 10:58:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFVPN-0004ZK-Ej; Fri, 07 Jun 2024 04:57:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFVPJ-0004Y9-R0 for emacs-orgmode@gnu.org; Fri, 07 Jun 2024 04:57:11 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFVPG-0001uj-HE for emacs-orgmode@gnu.org; Fri, 07 Jun 2024 04:57:09 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a6269885572so528232266b.1 for ; Fri, 07 Jun 2024 01:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717750624; x=1718355424; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B9HCsMEEiNdYgdyWVfCoesfYLzdibl0XQ2V/RCg45Qc=; b=OSB3GFhgiUEUFvpOenOcbe+gsmWE+rUgOjnHKJ4RggH8UULi6fx5M6AKn3E5nSv3DB LopAtFe22XokNp62eHJK7idr0MPyMHJtGMQq4SWN/Boc57Bmg+5UDnr7MEjOgzWeVKVP 4Goho3pyRMMjExC/M2DqtpXYZcMCMlbGQpIOVRrjjJMTaiEr4Ih1zDyfOLavofIz/iXI /1O3/BkO96TVbX14bKB30dvskJe08zokNMS1pAblf+66GQHl3RM0PzmSFAENNZXHBDuY dnJFG8CoTQvjW1U7J1zv+zr9mGYg/9+xH3c5PGbavg3O4iOuYggNkgWbOfho5NApqZeh spog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717750624; x=1718355424; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B9HCsMEEiNdYgdyWVfCoesfYLzdibl0XQ2V/RCg45Qc=; b=wiHUkFA11UpS0vpT1FEzezqQlMJDVVcj+9liSbKd3F6rmw/P1MwB2SbyZXg2jmq3SH q+YAL6o5SK/ue65VXkLH4Fc1YL2z0yGS+qEmkkww2z2oIceeO9Unu4ld0pRCYcmp9rga 9/pfKS1Tv6JyiAWlKTnim9+vlsRefAHwTbVU+Kd1rB7QYNQPxTMxe5JV2xokURZzLfAF 5kHu4sMLECkb/+6ZNAxOcjdU7SdpKjVM7B1HFn9JttZdh6efok4+pS+J1pDSlcg9IAnR ar6YxOEHzOxCZTmuQzuQl1nYK6DsRF3LVzGGLlFHhmrnVsEnuLKINbLigMkCay23P0RG 8YGA== X-Gm-Message-State: AOJu0YxqdfM8ULfqvq9INj87W9O42J1iMwSbZVv2AMe+bjV+W/xDpbQO kaqhnV6CBLahxT9FGmQW5ZhIWkjNoYzABnm6bFlOkl9OY14h3SagQnUZ+CNnMbTzUFERRKNNXwL LPSvE5pHp2FA4YfakGH5JKSuALVEfTg== X-Google-Smtp-Source: AGHT+IH3tCJi7+CLu8L+pTRn01xCIq006EGq6o5u5bsrD0xpb2pzvvlsvWuhHO1f1XVFdoyQQ5S2VGtOwMZD41d36I8= X-Received: by 2002:a17:906:c254:b0:a6c:70f3:de0f with SMTP id a640c23a62f3a-a6cbc6ca035mr173941066b.28.1717750623794; Fri, 07 Jun 2024 01:57:03 -0700 (PDT) MIME-Version: 1.0 References: <87a5jz5j88.fsf@localhost> In-Reply-To: <87a5jz5j88.fsf@localhost> From: Giuseppe Pagnoni Date: Fri, 7 Jun 2024 10:56:52 +0200 Message-ID: Subject: Re: Output of R code block: only text or plot but not both? And only one "result" can be output? To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000be7a9f061a48fb24" Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=gpagnoni@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 923E169B3E X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -8.67 X-Spam-Score: -8.67 X-TUID: WKsjAuVvzlhG --000000000000be7a9f061a48fb24 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Many thanks. Since I am using this within an org-mode notebook, I think the :session trick works well enough for me. best giuseppe On Wed, Jun 5, 2024 at 8:35=E2=80=AFPM Ihor Radchenko = wrote: > Giuseppe Pagnoni writes: > > > #+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? > > We currently do not have automatic way to do it, so that the resulting > plots are inserted as previewable file links. However, in addition to > the approach with several :session source blocks proposed by Berry, you > can do it by hand in R: > > #+begin_src R :results output raw drawer :dir ./ > x <- rnorm(100) > print(mean(x)) > png(file=3D"hist1.png") > hist(x) > png(file=3D"hist2.png") > hist(x^2) > print("[[./hist1.png]]") > print("[[./hist2.png]]") > #+end_src > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --=20 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 --000000000000be7a9f061a48fb24 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Many thanks.=C2=A0 Since I am using this within an org-mod= e notebook, I think the :session trick works well enough for me.

best
giuseppe

=
On Wed, Jun 5, 2024 at 8:35=E2=80=AFP= M Ihor Radchenko <yantar92@posteo= .net> wrote:
Giuseppe Pagnoni <gpagnoni@gmail.com> writes:

> #+begin_src R :file example.png :results output graphics file
>=C2=A0 =C2=A0x <- rnorm(100)
>=C2=A0 =C2=A0print(mean(x))
>=C2=A0 =C2=A0hist(x)
>=C2=A0 =C2=A0hist(x^2)
> #+end_src
>
> Here, only the last plot gets displayed.=C2=A0 Is it not possible to d= isplay
> more than 1 plot?

We currently do not have automatic way to do it, so that the resulting
plots are inserted as previewable file links.=C2=A0 However, in addition to=
the approach with several :session source blocks proposed by Berry, you
can do it by hand in R:

#+begin_src R :results output raw drawer :dir ./
=C2=A0 x <- rnorm(100)
=C2=A0 print(mean(x))
=C2=A0 png(file=3D"hist1.png")
=C2=A0 hist(x)
=C2=A0 png(file=3D"hist2.png")
=C2=A0 hist(x^2)
=C2=A0 print("[[./hist1.png]]")
=C2=A0 print("[[./hist2.png]]")
#+end_src

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,=
or support my work at <https://liberapay.com/yantar92>


--
Gi= useppe Pagnoni
Dip. Scienze Biomediche, Metaboliche e Neuroscienze
Se= zione Fisiologia e Neuroscienze
Univ. di Modena e Reggio Emilia
Via C= ampi 287
I-41125 Modena, Italy
Tel: +39-059-205-5742
Fax: +39-059-= 205-5363

--000000000000be7a9f061a48fb24--