From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: SO question on dynamic arguments Date: Tue, 14 Feb 2012 23:53:58 +0100 Message-ID: <87r4xx10xl.fsf@med.uni-goettingen.de> References: <21A5E1E970CD46459ECBE86D6CC4B28C53418407@spexch01.WindLogics.local> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxRGX-0007Zf-LW for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 17:54:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxRGW-00027O-EJ for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 17:54:29 -0500 Received: from plane.gmane.org ([80.91.229.3]:44004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxRGW-00027D-7W for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 17:54:28 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RxRGU-0002ws-8X for emacs-orgmode@gnu.org; Tue, 14 Feb 2012 23:54:26 +0100 Received: from vpn-2205.gwdg.de ([134.76.2.205]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Feb 2012 23:54:26 +0100 Received: from andreas.leha by vpn-2205.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Feb 2012 23:54:26 +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 Ken Williams writes: > I asked this question on Stack Overflow today, I wonder if someone > might know the answer here: > >   > >   > http://stackoverflow.com/questions/9215216/computing-argument-values-dynamically > >   > > It’s about computing arguments to a “#+begin_src R” block based on > previous R results. > >   > > Thanks. > >   > > -- > > Ken Williams, Senior Research Scientist > > WindLogics > > http://windlogics.com > >   > > > ---------------------------------------------------------------------- > CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. Any unauthorized review, use, disclosure or distribution > of any kind is strictly prohibited. If you are not the intended > recipient, please contact the sender via reply e-mail and destroy all > copies of the original message. Thank you. Hi Ken, I think you can not extract variables from underlying processes (like R) in org. What you can do in your example, however, is (1) name the first source block (2) call it with sbe (3) do the calculation in emacs-lisp which would look something like this: ,----[ example ] | #+name: setheight | #+begin_src R | x <- 5 | #+end_src | | #+begin_src R :results graphics :file foo.svg :height (* 3 (string-to-int (sbe setheight))) | plot(1:10) | #+end_src `---- Cheers, Andreas