From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: Out of Order Evaluation Date: Thu, 20 Mar 2014 23:13:26 +0100 Message-ID: <87lhw4cyd5.fsf@med.uni-goettingen.de> References: <8AE0B11E-8EA2-41A8-8D0C-CDB610785239@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQlDf-0007Z9-8h for emacs-orgmode@gnu.org; Thu, 20 Mar 2014 18:13:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQlDX-0002Oi-UI for emacs-orgmode@gnu.org; Thu, 20 Mar 2014 18:13:47 -0400 Received: from plane.gmane.org ([80.91.229.3]:47382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQlDX-0002OT-Nc for emacs-orgmode@gnu.org; Thu, 20 Mar 2014 18:13:39 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WQlDV-0001Fh-BC for emacs-orgmode@gnu.org; Thu, 20 Mar 2014 23:13:37 +0100 Received: from vpn-2080.gwdg.de ([134.76.2.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Mar 2014 23:13:37 +0100 Received: from andreas.leha by vpn-2080.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Mar 2014 23:13:37 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Michael, Michael Weylandt writes: > Hi, > > I want to put a summary of my analysis at the beginning of a document > using results calculated at the end of the document. Is this possible? > > #========= > #+TITLE: Test > #+AUTHOR: Michael Weylandt > #+PROPERTY: header-args:R :session *__R__* :exports both > > * Summary > The mean result was src_R[:exports results]{mean(x)} > > * Analysis, > We do some complicated calculations: > > #+BEGIN_SRC R > x <- rnorm(5) > #+END_SRC > #========= > > Is this possible in a single pass? I've played with #+NAME and > <> but haven't gotten the out-of-order evaluation quite > right. > > Michael > How about something along: --8<---------------cut here---------------start------------->8--- #+TITLE: Test #+AUTHOR: Michael Weylandt #+PROPERTY: header-args:R :session *__R__* :exports both * Summary The mean result was src_R[:exports results :var analysisresults=theanalysis()]{mean(unlist(analysisresults))} * Analysis, We do some complicated calculations: #+name: theanalysis #+BEGIN_SRC R x <- rnorm(5) #+END_SRC --8<---------------cut here---------------end--------------->8--- Regards, Andreas