From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SNFTLglVxmIqngAAbAwnHQ (envelope-from ) for ; Thu, 07 Jul 2022 05:37:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0KNJLglVxmJsWgEA9RJhRA (envelope-from ) for ; Thu, 07 Jul 2022 05:37:45 +0200 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 300C11F2DD for ; Thu, 7 Jul 2022 05:37:45 +0200 (CEST) Received: from localhost ([::1]:53332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9IKj-0008B9-BB for larch@yhetil.org; Wed, 06 Jul 2022 23:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9IJa-0008Ax-FW for emacs-orgmode@gnu.org; Wed, 06 Jul 2022 23:36:30 -0400 Received: from mail-dm6nam12olkn20815.outbound.protection.outlook.com ([2a01:111:f400:fe59::815]:10306 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9IJX-0003ve-68 for emacs-orgmode@gnu.org; Wed, 06 Jul 2022 23:36:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S6/iGJE7FVerFrwYgwm4U8k4RSFmbBvo8uMKeICekRi0/k5i8vwgUY8rjAdE62qZjC0EwcquFXJNGl6K0ZwoLkBLSdKxiq/G/FtJko6bBi97Bq7XndooSuJ63P2dXmI7+aE0h3sWtaJh8rM7EOWkgM+fm+7Xq+JxNqy/1jk+fUOCxjcZsQHY1AJ8i/ZnylyGXc2E00sC2+oSPsUIm2cc9gpKqi2TP1ZYxpAYkRjqSVr4BNcjM0xZzqEGAxlgd0+UQLZNRVAROtKucJnrUt/ZUM0xlf5AlNpebqxrRFZPPRDFNSVsSJZRRHH+HJdId+fC3iP+GbReIZRXUDGGPUHt1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6TMNIsDe44Ia5heFBddZ4WaJgqMfl9IPo2/CA0MWxgM=; b=Y/QghCrDfiBbJiYZIK6P/7zqfd3Him1ngUOBPWtzvRtuWrx1isUBqgQxYAiyrT0qMOhfLq3k0iKHzwxAEdTKkoSRb5G18mZP37cnzvJLapDKFdwB0lz1K9F2G4Fuz6gopMFNRW7FW2Ctip2SA7jWKZBDU+ZRzXojsd0dAw57hP2F8ACKVYRzfRdtpsvChTGL8y9rWOxD9nPHvePwTz2tjkhfBNJ1UyW0fjgFbMALiqFwrDspfGLD+YQy5s5xWLvASADMSeHoMML/xnEkoBSh1riTJNYuK9OcoXYWxDO4BMJnBvYG2d7nA8VZI7SWA+AmUW8lRcZaijQVWqOnme/8qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6TMNIsDe44Ia5heFBddZ4WaJgqMfl9IPo2/CA0MWxgM=; b=bFCaHN1m2Zg1AzPtHIQrTlKuofvaBYOh/8TWcs/Gs+aU88EltX9wFkvWJiDk0oLqZvhhgGH8hPmFiX5yEXzX/h6o4ClxVeI8ZtOth8fBBz+sQBC7bMzEFOLjyoD+OHS/rUbUumibgy3R3ziaPPiax7yXcOC0+87W+e47QQDQ0bF03cF7Emltm0mlGyBxE2cznS28MBkud4xSwtuOhGMFaotflc3R7wTkihd1497do/49g267dQjL/Uj6SYnOgfCyuEr8cbCDyWs4cO5vRgp3TcRJJwQ+BOApfsFmmy4RkVnjn94vCPlN32z+d6o4Oxr+qFL8PY0NCz9z4AY8y+yXXA== Received: from BL0PR01MB4036.prod.exchangelabs.com (2603:10b6:208:41::29) by SN2PR01MB2111.prod.exchangelabs.com (2603:10b6:804:7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Thu, 7 Jul 2022 03:31:20 +0000 Received: from BL0PR01MB4036.prod.exchangelabs.com ([fe80::699a:c53f:71a0:ce2c]) by BL0PR01MB4036.prod.exchangelabs.com ([fe80::699a:c53f:71a0:ce2c%7]) with mapi id 15.20.5395.021; Thu, 7 Jul 2022 03:31:20 +0000 From: Naresh Gurbuxani To: "emacs-orgmode@gnu.org" Subject: Efficiently reuse code in org babel with R Thread-Topic: Efficiently reuse code in org babel with R Thread-Index: AQHYkbDI8KNPnyTmtE6A5Gztxxeu0g== Date: Thu, 7 Jul 2022 03:31:20 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-tmn: [iILNjphxcWE7/kNqO242H9Js5irDwOtW] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b2c255b0-aefa-4e19-a83f-08da5fc928e2 x-ms-traffictypediagnostic: SN2PR01MB2111:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: iarT7B9A52DaN/scT6oUFCvcsttHS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-8859-1?Q?6juNNDsJEyw1WcMhp/LuE1ZUMBOThYrpTzU0/h/3xhABnR+hMneYu6W1yK?= =?iso-8859-1?Q?w3HGxFrHktVS/FD+d+D2c26VHXnp7v8pGHvOGkJ6WdKQKtXsZjpftpptFH?= =?iso-8859-1?Q?0ugRrsIcgx6F7yqFJNj4HyPI5obNT81AC0jJRpye98YtEKnnZBg90TwKZO?= =?iso-8859-1?Q?9nwBcVzuqkeyddWfKZ/kE6SWwQ=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-24fb5.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR01MB4036.prod.exchangelabs.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: b2c255b0-aefa-4e19-a83f-08da5fc928e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2022 03:31:20.5042 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR01MB2111 Received-SPF: pass client-ip=2a01:111:f400:fe59::815; envelope-from=naresh_gurbuxani@hotmail.com; helo=NAM12-DM6-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657165065; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=6TMNIsDe44Ia5heFBddZ4WaJgqMfl9IPo2/CA0MWxgM=; b=SvMFI2yAC4Hpn3v0Wn+Dr8vO/s1lLZG+2xMN0So9FEou/sRJsCUGFegi6lDUC+BAbLqoyR X12gaw9ms02SOgwJdsmJDkeb508uk/DAxAfqX4N6jzOF8ybOpwuHa2gJi892o72qJpJPKG Xi0lEqP2m+iyAkFggQJ2rjgeOZ27gysY7Bu5LSbm9TT13e90KQFtSxSV+zoLioQZ5cXTe0 TLzHJlfRRV7MUX5HFT55F4B1bAZE4PuUTzYmI+VMJSBfzIC8ZTcFp2ug8e7bmy9KYwF5IE SNsdnApWzzqzfpAGi5e9ieqvqi7GrzvgFLpFb7UtquP6joGErzkxMLlRPGtFhQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1657165065; a=rsa-sha256; cv=pass; b=hhUBz4udhS+wqEBHCL2LxOy3HUPrpVcLp9iNF/tEa7TQddaToj0/hR7TK/oEKP9EB4yEhw S+fGRGVuU3YnxJVcK+bKOBZlFd1zXRJ8BhjfWRAwRUojblCOZB1DTJLTxtw6FqgRZFTK5K uRl6V2tsqGYyDOqiauf7k2qzkX3BYDCs6Mc1nbogWOo7LLX5qgzFLOOmaFFwmUsES6p6eW aawO+TslOtLR85sgRtdaJ9oglTn9KJrc5ImUTQtgyUsHNVeW3WN07QjuTUz670B1OPUPsU FgWMLHT0IFrwSojxGgoV8OBx6Znen+g641hHtro4jokcbjxaW/uMDChgCJzAFQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=bFCaHN1m; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.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" X-Migadu-Spam-Score: -8.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=bFCaHN1m; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.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" X-Migadu-Queue-Id: 300C11F2DD X-Spam-Score: -8.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0MfoqRPfG2hy I want to source some data from databases, then use this data in various bl= ocks. I am looking for the most efficient way to achieve this. In below b= locks, is the code in block ``connection'' executed thrice (economy of code= but no saving of time) or is it only executed once then used twice? If th= e code is run thrice, is there another way to create code blocks so that th= e code is executed only once?=0A= =0A= Thanks,=0A= Naresh=0A= =0A= #+name: connection=0A= #+begin_src R :exports results :results output=0A= ## my code here=0A= #+end_src=0A= =0A= #+begin_src R :exports results :results output graphics file :file figures/= fig1.png=0A= <>=0A= ## my code here=0A= #+end_src=0A= =0A= #+begin_src R :exports results output graphics file :file figures/fig2.png= =0A= <>=0A= ## my code here=0A= #+end_src=